Skip to content

Commit

Permalink
Toolpath API changed
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderoster committed Jul 15, 2023
1 parent ffd2dda commit 9748f76
Show file tree
Hide file tree
Showing 21 changed files with 72 additions and 118 deletions.
6 changes: 2 additions & 4 deletions Autogenerated/Bindings/C/lib3mf.h
Original file line number Diff line number Diff line change
Expand Up @@ -3508,12 +3508,11 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_writepolyline(Lib3MF_Toolp
*
* @param[in] pToolpathLayerData - ToolpathLayerData instance.
* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty.
* @param[in] pNameSpacePrefix - Namespace prefix of the custom data tree. Namespace prefix MUST be unique to the layer.
* @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_toolpathlayerdata_addcustomdata(Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pNameSpacePrefix, const char * pDataName, Lib3MF_CustomDOMTree * pData);
LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_addcustomdata(Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData);

/**
* finishes all writing of the layer and compresses toolpath data.
Expand Down Expand Up @@ -3709,12 +3708,11 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_finduniquecustomdata(Lib3MF_Toolpat
*
* @param[in] pToolpath - Toolpath instance.
* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty.
* @param[in] pNameSpacePrefix - Namespace prefix of the custom data tree. Namespace prefix MUST be unique to the document.
* @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_toolpath_addcustomdata(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pNameSpacePrefix, const char * pDataName, Lib3MF_CustomDOMTree * pData);
LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_addcustomdata(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData);

/**
* Deletes all custom data.
Expand Down
6 changes: 2 additions & 4 deletions Autogenerated/Bindings/CDynamic/lib3mf_dynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -3495,12 +3495,11 @@ typedef Lib3MFResult (*PLib3MFToolpathLayerData_WritePolylinePtr) (Lib3MF_Toolpa
*
* @param[in] pToolpathLayerData - ToolpathLayerData instance.
* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty.
* @param[in] pNameSpacePrefix - Namespace prefix of the custom data tree. Namespace prefix MUST be unique to the layer.
* @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 (*PLib3MFToolpathLayerData_AddCustomDataPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pNameSpacePrefix, const char * pDataName, Lib3MF_CustomDOMTree * pData);
typedef Lib3MFResult (*PLib3MFToolpathLayerData_AddCustomDataPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData);

/**
* finishes all writing of the layer and compresses toolpath data.
Expand Down Expand Up @@ -3696,12 +3695,11 @@ typedef Lib3MFResult (*PLib3MFToolpath_FindUniqueCustomDataPtr) (Lib3MF_Toolpath
*
* @param[in] pToolpath - Toolpath instance.
* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty.
* @param[in] pNameSpacePrefix - Namespace prefix of the custom data tree. Namespace prefix MUST be unique to the document.
* @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 (*PLib3MFToolpath_AddCustomDataPtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pNameSpacePrefix, const char * pDataName, Lib3MF_CustomDOMTree * pData);
typedef Lib3MFResult (*PLib3MFToolpath_AddCustomDataPtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData);

/**
* Deletes all custom data.
Expand Down
14 changes: 6 additions & 8 deletions Autogenerated/Bindings/CSharp/Lib3MF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ public class Lib3MFWrapper
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[] ANameSpacePrefix, byte[] ADataName, out IntPtr AData);
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);
Expand Down Expand Up @@ -1390,7 +1390,7 @@ public class Lib3MFWrapper
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[] ANameSpacePrefix, byte[] ADataName, out IntPtr AData);
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);
Expand Down Expand Up @@ -5567,14 +5567,13 @@ public void WritePolyline (UInt32 AProfileID, UInt32 APartID, sPosition2D[] APoi
dataPointData.Free ();
}

public CCustomDOMTree AddCustomData (String ANameSpace, String ANameSpacePrefix, String ADataName)
public CCustomDOMTree AddCustomData (String ANameSpace, String ADataName)
{
byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue);
byte[] byteNameSpacePrefix = Encoding.UTF8.GetBytes(ANameSpacePrefix + char.MinValue);
byte[] byteDataName = Encoding.UTF8.GetBytes(ADataName + char.MinValue);
IntPtr newData = IntPtr.Zero;

CheckError(Internal.Lib3MFWrapper.ToolpathLayerData_AddCustomData (Handle, byteNameSpace, byteNameSpacePrefix, byteDataName, out newData));
CheckError(Internal.Lib3MFWrapper.ToolpathLayerData_AddCustomData (Handle, byteNameSpace, byteDataName, out newData));
return Internal.Lib3MFWrapper.PolymorphicFactory<CCustomDOMTree>(newData);
}

Expand Down Expand Up @@ -5757,14 +5756,13 @@ public CCustomDOMTree FindUniqueCustomData (String ANameSpace, String ADataName)
return Internal.Lib3MFWrapper.PolymorphicFactory<CCustomDOMTree>(newData);
}

public CCustomDOMTree AddCustomData (String ANameSpace, String ANameSpacePrefix, String ADataName)
public CCustomDOMTree AddCustomData (String ANameSpace, String ADataName)
{
byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue);
byte[] byteNameSpacePrefix = Encoding.UTF8.GetBytes(ANameSpacePrefix + char.MinValue);
byte[] byteDataName = Encoding.UTF8.GetBytes(ADataName + char.MinValue);
IntPtr newData = IntPtr.Zero;

CheckError(Internal.Lib3MFWrapper.Toolpath_AddCustomData (Handle, byteNameSpace, byteNameSpacePrefix, byteDataName, out newData));
CheckError(Internal.Lib3MFWrapper.Toolpath_AddCustomData (Handle, byteNameSpace, byteDataName, out newData));
return Internal.Lib3MFWrapper.PolymorphicFactory<CCustomDOMTree>(newData);
}

Expand Down
6 changes: 2 additions & 4 deletions Autogenerated/Bindings/Cpp/lib3mf_abi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3508,12 +3508,11 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_writepolyline(Lib3MF_Toolp
*
* @param[in] pToolpathLayerData - ToolpathLayerData instance.
* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty.
* @param[in] pNameSpacePrefix - Namespace prefix of the custom data tree. Namespace prefix MUST be unique to the layer.
* @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_toolpathlayerdata_addcustomdata(Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pNameSpacePrefix, const char * pDataName, Lib3MF_CustomDOMTree * pData);
LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_addcustomdata(Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData);

/**
* finishes all writing of the layer and compresses toolpath data.
Expand Down Expand Up @@ -3709,12 +3708,11 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_finduniquecustomdata(Lib3MF_Toolpat
*
* @param[in] pToolpath - Toolpath instance.
* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty.
* @param[in] pNameSpacePrefix - Namespace prefix of the custom data tree. Namespace prefix MUST be unique to the document.
* @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_toolpath_addcustomdata(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pNameSpacePrefix, const char * pDataName, Lib3MF_CustomDOMTree * pData);
LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_addcustomdata(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData);

/**
* Deletes all custom data.
Expand Down
14 changes: 6 additions & 8 deletions Autogenerated/Bindings/Cpp/lib3mf_implicit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1705,7 +1705,7 @@ class CToolpathLayerData : public CBase {
inline void WriteHatchData(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const CInputVector<sPosition2D> & PointDataBuffer);
inline void WriteLoop(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const CInputVector<sPosition2D> & PointDataBuffer);
inline void WritePolyline(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const CInputVector<sPosition2D> & PointDataBuffer);
inline PCustomDOMTree AddCustomData(const std::string & sNameSpace, const std::string & sNameSpacePrefix, const std::string & sDataName);
inline PCustomDOMTree AddCustomData(const std::string & sNameSpace, const std::string & sDataName);
inline void Finish();
};

Expand Down Expand Up @@ -1740,7 +1740,7 @@ class CToolpath : public CResource {
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 & sNameSpacePrefix, const std::string & sDataName);
inline PCustomDOMTree AddCustomData(const std::string & sNameSpace, const std::string & sDataName);
inline Lib3MF_uint32 ClearCustomData();
inline bool DeleteCustomData(classParam<CCustomDOMTree> pData);
inline void RegisterCustomIntegerAttribute(const std::string & sNameSpace, const std::string & sAttributeName);
Expand Down Expand Up @@ -6623,14 +6623,13 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle)
/**
* 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] sNameSpacePrefix - Namespace prefix of the custom data tree. Namespace prefix MUST be unique to the layer.
* @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.
*/
PCustomDOMTree CToolpathLayerData::AddCustomData(const std::string & sNameSpace, const std::string & sNameSpacePrefix, const std::string & sDataName)
PCustomDOMTree CToolpathLayerData::AddCustomData(const std::string & sNameSpace, const std::string & sDataName)
{
Lib3MFHandle hData = nullptr;
CheckError(lib3mf_toolpathlayerdata_addcustomdata(m_pHandle, sNameSpace.c_str(), sNameSpacePrefix.c_str(), sDataName.c_str(), &hData));
CheckError(lib3mf_toolpathlayerdata_addcustomdata(m_pHandle, sNameSpace.c_str(), sDataName.c_str(), &hData));

if (!hData) {
CheckError(LIB3MF_ERROR_INVALIDPARAM);
Expand Down Expand Up @@ -6909,14 +6908,13 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle)
/**
* 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] sNameSpacePrefix - Namespace prefix of the custom data tree. Namespace prefix MUST be unique to the document.
* @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.
*/
PCustomDOMTree CToolpath::AddCustomData(const std::string & sNameSpace, const std::string & sNameSpacePrefix, const std::string & sDataName)
PCustomDOMTree CToolpath::AddCustomData(const std::string & sNameSpace, const std::string & sDataName)
{
Lib3MFHandle hData = nullptr;
CheckError(lib3mf_toolpath_addcustomdata(m_pHandle, sNameSpace.c_str(), sNameSpacePrefix.c_str(), sDataName.c_str(), &hData));
CheckError(lib3mf_toolpath_addcustomdata(m_pHandle, sNameSpace.c_str(), sDataName.c_str(), &hData));

if (!hData) {
CheckError(LIB3MF_ERROR_INVALIDPARAM);
Expand Down
6 changes: 2 additions & 4 deletions Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -3495,12 +3495,11 @@ typedef Lib3MFResult (*PLib3MFToolpathLayerData_WritePolylinePtr) (Lib3MF_Toolpa
*
* @param[in] pToolpathLayerData - ToolpathLayerData instance.
* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty.
* @param[in] pNameSpacePrefix - Namespace prefix of the custom data tree. Namespace prefix MUST be unique to the layer.
* @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 (*PLib3MFToolpathLayerData_AddCustomDataPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pNameSpacePrefix, const char * pDataName, Lib3MF_CustomDOMTree * pData);
typedef Lib3MFResult (*PLib3MFToolpathLayerData_AddCustomDataPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData);

/**
* finishes all writing of the layer and compresses toolpath data.
Expand Down Expand Up @@ -3696,12 +3695,11 @@ typedef Lib3MFResult (*PLib3MFToolpath_FindUniqueCustomDataPtr) (Lib3MF_Toolpath
*
* @param[in] pToolpath - Toolpath instance.
* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty.
* @param[in] pNameSpacePrefix - Namespace prefix of the custom data tree. Namespace prefix MUST be unique to the document.
* @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 (*PLib3MFToolpath_AddCustomDataPtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pNameSpacePrefix, const char * pDataName, Lib3MF_CustomDOMTree * pData);
typedef Lib3MFResult (*PLib3MFToolpath_AddCustomDataPtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData);

/**
* Deletes all custom data.
Expand Down
14 changes: 6 additions & 8 deletions Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,7 @@ class CToolpathLayerData : public CBase {
inline void WriteHatchData(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const CInputVector<sPosition2D> & PointDataBuffer);
inline void WriteLoop(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const CInputVector<sPosition2D> & PointDataBuffer);
inline void WritePolyline(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const CInputVector<sPosition2D> & PointDataBuffer);
inline PCustomDOMTree AddCustomData(const std::string & sNameSpace, const std::string & sNameSpacePrefix, const std::string & sDataName);
inline PCustomDOMTree AddCustomData(const std::string & sNameSpace, const std::string & sDataName);
inline void Finish();
};

Expand Down Expand Up @@ -1764,7 +1764,7 @@ class CToolpath : public CResource {
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 & sNameSpacePrefix, const std::string & sDataName);
inline PCustomDOMTree AddCustomData(const std::string & sNameSpace, const std::string & sDataName);
inline Lib3MF_uint32 ClearCustomData();
inline bool DeleteCustomData(classParam<CCustomDOMTree> pData);
inline void RegisterCustomIntegerAttribute(const std::string & sNameSpace, const std::string & sAttributeName);
Expand Down Expand Up @@ -13555,14 +13555,13 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle)
/**
* 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] sNameSpacePrefix - Namespace prefix of the custom data tree. Namespace prefix MUST be unique to the layer.
* @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.
*/
PCustomDOMTree CToolpathLayerData::AddCustomData(const std::string & sNameSpace, const std::string & sNameSpacePrefix, const std::string & sDataName)
PCustomDOMTree CToolpathLayerData::AddCustomData(const std::string & sNameSpace, const std::string & sDataName)
{
Lib3MFHandle hData = nullptr;
CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerData_AddCustomData(m_pHandle, sNameSpace.c_str(), sNameSpacePrefix.c_str(), sDataName.c_str(), &hData));
CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerData_AddCustomData(m_pHandle, sNameSpace.c_str(), sDataName.c_str(), &hData));

if (!hData) {
CheckError(LIB3MF_ERROR_INVALIDPARAM);
Expand Down Expand Up @@ -13841,14 +13840,13 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle)
/**
* 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] sNameSpacePrefix - Namespace prefix of the custom data tree. Namespace prefix MUST be unique to the document.
* @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.
*/
PCustomDOMTree CToolpath::AddCustomData(const std::string & sNameSpace, const std::string & sNameSpacePrefix, const std::string & sDataName)
PCustomDOMTree CToolpath::AddCustomData(const std::string & sNameSpace, const std::string & sDataName)
{
Lib3MFHandle hData = nullptr;
CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_AddCustomData(m_pHandle, sNameSpace.c_str(), sNameSpacePrefix.c_str(), sDataName.c_str(), &hData));
CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_AddCustomData(m_pHandle, sNameSpace.c_str(), sDataName.c_str(), &hData));

if (!hData) {
CheckError(LIB3MF_ERROR_INVALIDPARAM);
Expand Down
Loading

0 comments on commit 9748f76

Please sign in to comment.