diff --git a/lib3mf/Include/lib3mf_abi.hpp b/lib3mf/Include/lib3mf_abi.hpp index 16fece3..0c55803 100644 --- a/lib3mf/Include/lib3mf_abi.hpp +++ b/lib3mf/Include/lib3mf_abi.hpp @@ -1,6 +1,6 @@ /*++ -Copyright (C) 2019 3MF Consortium (Original Author) +Copyright (C) 2024 3MF Consortium (Original Author) All rights reserved. @@ -24,12 +24,12 @@ 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. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.6.0. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++-Header file in order to allow an easy use of the 3MF Library -Interface version: 2.2.0 +Interface version: 2.5.0 */ @@ -49,12 +49,23 @@ Interface version: 2.2.0 #include "lib3mf_types.hpp" +#ifdef __cplusplus extern "C" { +#endif /************************************************************************************************************************* Class definition for Base **************************************************************************************************************************/ +/** +* Get Class Type Id +* +* @param[in] pBase - Base instance. +* @param[out] pClassTypeId - Class type as a 64 bits integer +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_base_classtypeid(Lib3MF_Base pBase, Lib3MF_uint64 * pClassTypeId); + /************************************************************************************************************************* Class definition for Writer **************************************************************************************************************************/ @@ -564,6 +575,45 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerialsiterator_getcurrentcomposi */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup(Lib3MF_MultiPropertyGroupIterator pMultiPropertyGroupIterator, Lib3MF_MultiPropertyGroup * pResource); +/************************************************************************************************************************* + Class definition for Image3DIterator +**************************************************************************************************************************/ + +/** +* Returns the Image3D the iterator points at. +* +* @param[in] pImage3DIterator - Image3DIterator instance. +* @param[out] pResource - returns the Image3D instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_image3diterator_getcurrentimage3d(Lib3MF_Image3DIterator pImage3DIterator, Lib3MF_Image3D * pResource); + +/************************************************************************************************************************* + Class definition for FunctionIterator +**************************************************************************************************************************/ + +/** +* Returns the Function the iterator points at. +* +* @param[in] pFunctionIterator - FunctionIterator instance. +* @param[out] pResource - returns the Function instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functioniterator_getcurrentfunction(Lib3MF_FunctionIterator pFunctionIterator, Lib3MF_Function * pResource); + +/************************************************************************************************************************* + Class definition for LevelSetIterator +**************************************************************************************************************************/ + +/** +* Returns the LevelSet the iterator points at. +* +* @param[in] pLevelSetIterator - LevelSetIterator instance. +* @param[out] pResource - returns the MeshObject instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelsetiterator_getcurrentlevelset(Lib3MF_LevelSetIterator pLevelSetIterator, Lib3MF_LevelSet * pResource); + /************************************************************************************************************************* Class definition for MetaData **************************************************************************************************************************/ @@ -737,12 +787,141 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_removemetadata(Lib3MF_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[in] bMustPreserve - should the metadata be preserved * @param[out] pMetaData - a new instance of the metadata * @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 TriangleSet +**************************************************************************************************************************/ + +/** +* sets the name of the triangle set +* +* @param[in] pTriangleSet - TriangleSet instance. +* @param[in] pName - the new name +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_triangleset_setname(Lib3MF_TriangleSet pTriangleSet, const char * pName); + +/** +* returns the name of the triangle set +* +* @param[in] pTriangleSet - TriangleSet 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_triangleset_getname(Lib3MF_TriangleSet pTriangleSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); + +/** +* sets the identifier of the triangle set. +* +* @param[in] pTriangleSet - TriangleSet instance. +* @param[in] pIdentifier - the new identifier. MUST be unique within the mesh. MUST NOT be an empty string +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_triangleset_setidentifier(Lib3MF_TriangleSet pTriangleSet, const char * pIdentifier); + +/** +* returns the identifier of the triangle set +* +* @param[in] pTriangleSet - TriangleSet 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, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_triangleset_getidentifier(Lib3MF_TriangleSet pTriangleSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer); + +/** +* adds a triangle to the set. Does nothing if triangle is already in the set. +* +* @param[in] pTriangleSet - TriangleSet instance. +* @param[in] nTriangleIndex - Triangle index to add. MUST be between 0 and TriangleCount - 1. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_triangleset_addtriangle(Lib3MF_TriangleSet pTriangleSet, Lib3MF_uint32 nTriangleIndex); + +/** +* removes a triangle from the set +* +* @param[in] pTriangleSet - TriangleSet instance. +* @param[in] nTriangleIndex - Triangle index to remove. MUST be between 0 and TriangleCount - 1. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_triangleset_removetriangle(Lib3MF_TriangleSet pTriangleSet, Lib3MF_uint32 nTriangleIndex); + +/** +* clears all triangles from the list +* +* @param[in] pTriangleSet - TriangleSet instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_triangleset_clear(Lib3MF_TriangleSet pTriangleSet); + +/** +* Sets all triangles in the list, while clearing old values. Duplicates will be merged. +* +* @param[in] pTriangleSet - TriangleSet instance. +* @param[in] nTriangleIndicesBufferSize - Number of elements in buffer +* @param[in] pTriangleIndicesBuffer - uint32 buffer of Triangle indices to add. Every element MUST be between 0 and TriangleCount - 1. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_triangleset_settrianglelist(Lib3MF_TriangleSet pTriangleSet, Lib3MF_uint64 nTriangleIndicesBufferSize, const Lib3MF_uint32 * pTriangleIndicesBuffer); + +/** +* Retrieves all the triangles in the TriangleSet +* +* @param[in] pTriangleSet - TriangleSet instance. +* @param[in] nTriangleIndicesBufferSize - Number of elements in buffer +* @param[out] pTriangleIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pTriangleIndicesBuffer - uint32 buffer of retrieves the indices of the triangles in this TriangleSet +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_triangleset_gettrianglelist(Lib3MF_TriangleSet pTriangleSet, const Lib3MF_uint64 nTriangleIndicesBufferSize, Lib3MF_uint64* pTriangleIndicesNeededCount, Lib3MF_uint32 * pTriangleIndicesBuffer); + +/** +* Adds multiple triangles in the list. Duplicates will be merged. +* +* @param[in] pTriangleSet - TriangleSet instance. +* @param[in] nTriangleIndicesBufferSize - Number of elements in buffer +* @param[in] pTriangleIndicesBuffer - uint32 buffer of Triangle indices to add. Every element MUST be between 0 and TriangleCount - 1. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_triangleset_addtrianglelist(Lib3MF_TriangleSet pTriangleSet, Lib3MF_uint64 nTriangleIndicesBufferSize, const Lib3MF_uint32 * pTriangleIndicesBuffer); + +/** +* Merges another Triangle set. +* +* @param[in] pTriangleSet - TriangleSet instance. +* @param[in] pOtherTriangleSet - Other triangle set to merge. +* @param[in] bDeleteOther - Flag if other triangle set is getting removed. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_triangleset_merge(Lib3MF_TriangleSet pTriangleSet, Lib3MF_TriangleSet pOtherTriangleSet, bool bDeleteOther); + +/** +* Deletes the whole set from the mesh. +* +* @param[in] pTriangleSet - TriangleSet instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_triangleset_deleteset(Lib3MF_TriangleSet pTriangleSet); + +/** +* Duplicates the set in the mesh. +* +* @param[in] pTriangleSet - TriangleSet instance. +* @param[in] pIdentifier - the new identifier. MUST be unique within the mesh. MUST NOT be an empty string +* @param[out] pNewSet - Copy of the triangle set. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_triangleset_duplicate(Lib3MF_TriangleSet pTriangleSet, const char * pIdentifier, Lib3MF_TriangleSet * pNewSet); + /************************************************************************************************************************* Class definition for Object **************************************************************************************************************************/ @@ -823,6 +1002,15 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_ismeshobject(Lib3MF_Object pObject, b */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_iscomponentsobject(Lib3MF_Object pObject, bool * pIsComponentsObject); +/** +* Retrieves, if an object is a level set object +* +* @param[in] pObject - Object instance. +* @param[out] pIsLevelSetObject - returns, whether the object is a level set object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_islevelsetobject(Lib3MF_Object pObject, bool * pIsLevelSetObject); + /** * 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. * @@ -1155,6 +1343,224 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_ismanifoldandoriented(Lib3MF_Mesh */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_beamlattice(Lib3MF_MeshObject pMeshObject, Lib3MF_BeamLattice * pTheBeamLattice); +/** +* Retrieves the VolumeData of this MeshObject. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pTheVolumeData - the VolumeData of this MeshObject +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getvolumedata(Lib3MF_MeshObject pMeshObject, Lib3MF_VolumeData * pTheVolumeData); + +/** +* Sets the VolumeData of this MeshObject. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] pTheVolumeData - the VolumeData of this MeshObject +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setvolumedata(Lib3MF_MeshObject pMeshObject, Lib3MF_VolumeData pTheVolumeData); + +/** +* Adds a new triangle set. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] pIdentifier - the new identifier. MUST be unique within the mesh. MUST NOT be an empty string +* @param[in] pName - the human readable name. MUST NOT be an empty string +* @param[out] pTheTriangleSet - the new Triangle Set Instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_addtriangleset(Lib3MF_MeshObject pMeshObject, const char * pIdentifier, const char * pName, Lib3MF_TriangleSet * pTheTriangleSet); + +/** +* Checks if a triangle set exists. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] pIdentifier - the identifier to be found. +* @param[out] pTriangleSetExists - flag if the triangles set exists. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_hastriangleset(Lib3MF_MeshObject pMeshObject, const char * pIdentifier, bool * pTriangleSetExists); + +/** +* Finds a new triangle set by identifier. Fails if not existing. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] pIdentifier - the identifier to be found. +* @param[out] pTheTriangleSet - the triangle Set Instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_findtriangleset(Lib3MF_MeshObject pMeshObject, const char * pIdentifier, Lib3MF_TriangleSet * pTheTriangleSet); + +/** +* Returns number of triangle sets. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pCount - the number of triangle sets of this mesh. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettrianglesetcount(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pCount); + +/** +* Returns a specific triangle set by index. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - the index of the triangle set. +* @param[out] pTheTriangleSet - the triangle Set Instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettriangleset(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, Lib3MF_TriangleSet * pTheTriangleSet); + +/************************************************************************************************************************* + Class definition for LevelSet +**************************************************************************************************************************/ + +/** +* Returns the function that is used as boundary shape. +* +* @param[in] pLevelSet - LevelSet instance. +* @param[out] pTheFunction - the function to use as boundary shape +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_getfunction(Lib3MF_LevelSet pLevelSet, Lib3MF_Function * pTheFunction); + +/** +* Sets the function to use as boundary shape. +* +* @param[in] pLevelSet - LevelSet instance. +* @param[in] pTheFunction - the function to use as boundary shape +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_setfunction(Lib3MF_LevelSet pLevelSet, Lib3MF_Function pTheFunction); + +/** +* Returns the transformation matrix into the coordinate system of the referenced Function. +* +* @param[in] pLevelSet - LevelSet instance. +* @param[out] pTransform - the transformation matrix +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_gettransform(Lib3MF_LevelSet pLevelSet, Lib3MF::sTransform * pTransform); + +/** +* Sets the transformation matrix into the coordinate system of the referenced Function. +* +* @param[in] pLevelSet - LevelSet instance. +* @param[in] pTransform - new transformation matrix +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_settransform(Lib3MF_LevelSet pLevelSet, const Lib3MF::sTransform * pTransform); + +/** +* Returns the name of the function output channel to use. +* +* @param[in] pLevelSet - LevelSet instance. +* @param[in] nChannelNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pChannelNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pChannelNameBuffer - buffer of the name of the function output channel, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_getchannelname(Lib3MF_LevelSet pLevelSet, const Lib3MF_uint32 nChannelNameBufferSize, Lib3MF_uint32* pChannelNameNeededChars, char * pChannelNameBuffer); + +/** +* Sets the name of the function output channel to use. +* +* @param[in] pLevelSet - LevelSet instance. +* @param[in] pChannelName - new name of the function output channel +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_setchannelname(Lib3MF_LevelSet pLevelSet, const char * pChannelName); + +/** +* Sets the minimal feature size as a hint for the function evaluator +* +* @param[in] pLevelSet - LevelSet instance. +* @param[in] dMinFeatureSize - minimal feature size +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_setminfeaturesize(Lib3MF_LevelSet pLevelSet, Lib3MF_double dMinFeatureSize); + +/** +* Returns the minimal feature size as a hint for the function evaluator +* +* @param[in] pLevelSet - LevelSet instance. +* @param[out] pMinFeatureSize - minimal feature size +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_getminfeaturesize(Lib3MF_LevelSet pLevelSet, Lib3MF_double * pMinFeatureSize); + +/** +* Sets the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). +* +* @param[in] pLevelSet - LevelSet instance. +* @param[in] dFallBackValue - fallback value +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_setfallbackvalue(Lib3MF_LevelSet pLevelSet, Lib3MF_double dFallBackValue); + +/** +* Returns the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). +* +* @param[in] pLevelSet - LevelSet instance. +* @param[out] pFallBackValue - fallback value +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_getfallbackvalue(Lib3MF_LevelSet pLevelSet, Lib3MF_double * pFallBackValue); + +/** +* If set only the bounding box of the mesh is intersected with the boundary +* +* @param[in] pLevelSet - LevelSet instance. +* @param[in] bMeshBBoxOnly - If set only the bounding box of the mesh is intersected with the boundary +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_setmeshbboxonly(Lib3MF_LevelSet pLevelSet, bool bMeshBBoxOnly); + +/** +* If set only the bounding box of the mesh is intersected with the boundary +* +* @param[in] pLevelSet - LevelSet instance. +* @param[out] pMeshBBoxOnly - If set only the bounding box of the mesh is intersected with the boundary +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_getmeshbboxonly(Lib3MF_LevelSet pLevelSet, bool * pMeshBBoxOnly); + +/** +* Sets the mesh to use as evaluation domain +* +* @param[in] pLevelSet - LevelSet instance. +* @param[in] pTheMesh - The mesh +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_setmesh(Lib3MF_LevelSet pLevelSet, Lib3MF_MeshObject pTheMesh); + +/** +* Returns the mesh that is used as evaluation domain +* +* @param[in] pLevelSet - LevelSet instance. +* @param[out] pTheMesh - The mesh +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_getmesh(Lib3MF_LevelSet pLevelSet, Lib3MF_MeshObject * pTheMesh); + +/** +* Retrieves the VolumeData this Object. +* +* @param[in] pLevelSet - LevelSet instance. +* @param[out] pTheVolumeData - the VolumeData of this Object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_getvolumedata(Lib3MF_LevelSet pLevelSet, Lib3MF_VolumeData * pTheVolumeData); + +/** +* Sets the VolumeData of this LevelSet. +* +* @param[in] pLevelSet - LevelSet instance. +* @param[in] pTheVolumeData - the VolumeData of this MeshObject +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_setvolumedata(Lib3MF_LevelSet pLevelSet, Lib3MF_VolumeData pTheVolumeData); + /************************************************************************************************************************* Class definition for BeamLattice **************************************************************************************************************************/ @@ -1384,6 +1790,299 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_addbeamset(Lib3MF_BeamLattice pB */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet); +/************************************************************************************************************************* + Class definition for FunctionReference +**************************************************************************************************************************/ + +/** +* Returns the UniqueResourceID of the Function. Only functions with a 'pos'-input are allowed. +* +* @param[in] pFunctionReference - FunctionReference instance. +* @param[out] pUniqueResourceID - returns the UniqueResourceID. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionreference_getfunctionresourceid(Lib3MF_FunctionReference pFunctionReference, Lib3MF_uint32 * pUniqueResourceID); + +/** +* Sets the UniqueResourceID to refer to. +* +* @param[in] pFunctionReference - FunctionReference instance. +* @param[in] nUniqueResourceID - UniqueResourceID of the function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionreference_setfunctionresourceid(Lib3MF_FunctionReference pFunctionReference, Lib3MF_uint32 nUniqueResourceID); + +/** +* Returns the transformation matrix into the coordinate system of the referenced Function. +* +* @param[in] pFunctionReference - FunctionReference instance. +* @param[out] pTransform - the transformation matrix +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionreference_gettransform(Lib3MF_FunctionReference pFunctionReference, Lib3MF::sTransform * pTransform); + +/** +* Sets the transformation matrix into the coordinate system of the referenced Function. +* +* @param[in] pFunctionReference - FunctionReference instance. +* @param[in] pTransform - new transformation matrix +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionreference_settransform(Lib3MF_FunctionReference pFunctionReference, const Lib3MF::sTransform * pTransform); + +/** +* Returns the name of the function output channel to use. +* +* @param[in] pFunctionReference - FunctionReference instance. +* @param[in] nChannelNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pChannelNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pChannelNameBuffer - buffer of the name of the function output channel, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionreference_getchannelname(Lib3MF_FunctionReference pFunctionReference, const Lib3MF_uint32 nChannelNameBufferSize, Lib3MF_uint32* pChannelNameNeededChars, char * pChannelNameBuffer); + +/** +* Sets the name of the function output channel to use. +* +* @param[in] pFunctionReference - FunctionReference instance. +* @param[in] pChannelName - new name of the function output channel +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionreference_setchannelname(Lib3MF_FunctionReference pFunctionReference, const char * pChannelName); + +/** +* Sets the minimal feature size as a hint for the function evaluator +* +* @param[in] pFunctionReference - FunctionReference instance. +* @param[in] dMinFeatureSize - minimal feature size +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionreference_setminfeaturesize(Lib3MF_FunctionReference pFunctionReference, Lib3MF_double dMinFeatureSize); + +/** +* Returns the minimal feature size as a hint for the function evaluator +* +* @param[in] pFunctionReference - FunctionReference instance. +* @param[out] pMinFeatureSize - minimal feature size +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionreference_getminfeaturesize(Lib3MF_FunctionReference pFunctionReference, Lib3MF_double * pMinFeatureSize); + +/** +* Sets the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). +* +* @param[in] pFunctionReference - FunctionReference instance. +* @param[in] dFallBackValue - fallback value +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionreference_setfallbackvalue(Lib3MF_FunctionReference pFunctionReference, Lib3MF_double dFallBackValue); + +/** +* Returns the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). +* +* @param[in] pFunctionReference - FunctionReference instance. +* @param[out] pFallBackValue - fallback value +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionreference_getfallbackvalue(Lib3MF_FunctionReference pFunctionReference, Lib3MF_double * pFallBackValue); + +/************************************************************************************************************************* + Class definition for VolumeDataColor +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for MaterialMapping +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for VolumeDataComposite +**************************************************************************************************************************/ + +/** +* Returns the BaseMaterialGroup used within this volume data item +* +* @param[in] pVolumeDataComposite - VolumeDataComposite instance. +* @param[out] pBaseMaterialGroupInstance - The BaseMaterialGroup instance of this VolumeDataComposite element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedatacomposite_getbasematerialgroup(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance); + +/** +* Sets the BaseMaterialGroup to use within this volume data item. +* +* @param[in] pVolumeDataComposite - VolumeDataComposite instance. +* @param[in] pBaseMaterialGroupInstance - The new BaseMaterialGroup instance of this VolumeDataComposite element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedatacomposite_setbasematerialgroup(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_BaseMaterialGroup pBaseMaterialGroupInstance); + +/** +* Returns the number of material mappings of this VolumeDataComposite element +* +* @param[in] pVolumeDataComposite - VolumeDataComposite instance. +* @param[out] pCount - the number of material mappings. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedatacomposite_getmaterialmappingcount(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 * pCount); + +/** +* Returns MaterialMapping with given index +* +* @param[in] pVolumeDataComposite - VolumeDataComposite instance. +* @param[in] nIndex - Index of the MaterialMapping in question. +* @param[out] pTheMaterialMapping - MaterialMapping used in this element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedatacomposite_getmaterialmapping(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 nIndex, Lib3MF_MaterialMapping * pTheMaterialMapping); + +/** +* Adds a MaterialMapping +* +* @param[in] pVolumeDataComposite - VolumeDataComposite instance. +* @param[in] pTransform - new transformation matrix +* @param[out] pTheMaterialMapping - The new MaterialMapping +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedatacomposite_addmaterialmapping(Lib3MF_VolumeDataComposite pVolumeDataComposite, const Lib3MF::sTransform * pTransform, Lib3MF_MaterialMapping * pTheMaterialMapping); + +/** +* Removes the MaterialMapping with given index +* +* @param[in] pVolumeDataComposite - VolumeDataComposite instance. +* @param[in] nIndex - The index of the MaterialMapping to be removed. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedatacomposite_removematerialmapping(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 nIndex); + +/************************************************************************************************************************* + Class definition for VolumeDataProperty +**************************************************************************************************************************/ + +/** +* Gets the qualified name of this property. +* +* @param[in] pVolumeDataProperty - VolumeDataProperty instance. +* @param[in] nPropertyNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pPropertyNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPropertyNameBuffer - buffer of The qualified name of this property., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedataproperty_getname(Lib3MF_VolumeDataProperty pVolumeDataProperty, const Lib3MF_uint32 nPropertyNameBufferSize, Lib3MF_uint32* pPropertyNameNeededChars, char * pPropertyNameBuffer); + +/** +* Sets whether this property is required to process this 3MF document instance. +* +* @param[in] pVolumeDataProperty - VolumeDataProperty instance. +* @param[in] bIsRequired - New value for whether this property is required to process this 3MF document instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedataproperty_setisrequired(Lib3MF_VolumeDataProperty pVolumeDataProperty, bool bIsRequired); + +/** +* Returns whether this property is required to process this 3MF document instance. +* +* @param[in] pVolumeDataProperty - VolumeDataProperty instance. +* @param[out] pIsRequired - Is this property required to process this 3MF document instance? +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedataproperty_isrequired(Lib3MF_VolumeDataProperty pVolumeDataProperty, bool * pIsRequired); + +/************************************************************************************************************************* + Class definition for VolumeData +**************************************************************************************************************************/ + +/** +* Returns the VolumeDataComposite of this VolumeData instance +* +* @param[in] pVolumeData - VolumeData instance. +* @param[out] pTheCompositeData - filled with the VolumeDataComposite of this VolumeData instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedata_getcomposite(Lib3MF_VolumeData pVolumeData, Lib3MF_VolumeDataComposite * pTheCompositeData); + +/** +* Creates a new VolumeDataComposite for this VolumeData instance +* +* @param[in] pVolumeData - VolumeData instance. +* @param[out] pTheCompositeData - The new VolumeDataComposite of this VolumeData instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedata_createnewcomposite(Lib3MF_VolumeData pVolumeData, Lib3MF_VolumeDataComposite * pTheCompositeData); + +/** +* Removes the VolumeDataComposite of this VolumeData instance +* +* @param[in] pVolumeData - VolumeData instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedata_removecomposite(Lib3MF_VolumeData pVolumeData); + +/** +* Returns the VolumeDataColor of this VolumeData instance +* +* @param[in] pVolumeData - VolumeData instance. +* @param[out] pTheColorData - filled with the VolumeDataColor of this VolumeData instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedata_getcolor(Lib3MF_VolumeData pVolumeData, Lib3MF_VolumeDataColor * pTheColorData); + +/** +* Creates a new VolumeDataColor for this VolumeData instance +* +* @param[in] pVolumeData - VolumeData instance. +* @param[in] pTheFunction - Function used in this element +* @param[out] pTheColorData - The new VolumeDataColor of this VolumeData instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedata_createnewcolor(Lib3MF_VolumeData pVolumeData, Lib3MF_Function pTheFunction, Lib3MF_VolumeDataColor * pTheColorData); + +/** +* Removes the VolumeDataColor of this VolumeData instance +* +* @param[in] pVolumeData - VolumeData instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedata_removecolor(Lib3MF_VolumeData pVolumeData); + +/** +* Returns the number of VolumeDataProperty +* +* @param[in] pVolumeData - VolumeData instance. +* @param[out] pCount - the number of VolumeDataProperty-elements within this VolumeData +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedata_getpropertycount(Lib3MF_VolumeData pVolumeData, Lib3MF_uint32 * pCount); + +/** +* Returns the VolumeDataProperty at a given Index +* +* @param[in] pVolumeData - VolumeData instance. +* @param[in] nIndex - the index of the VolumeDataProperty to be returned. +* @param[out] pTheVolumeDataProperty - the VolumeDataProperty at the given index. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedata_getproperty(Lib3MF_VolumeData pVolumeData, Lib3MF_uint32 nIndex, Lib3MF_VolumeDataProperty * pTheVolumeDataProperty); + +/** +* Adds a new VolumeDataProperty from a Function +* +* @param[in] pVolumeData - VolumeData instance. +* @param[in] pName - the qualified name (namespace+name) of the Property +* @param[in] pTheFunction - Function used in this element +* @param[out] pTheVolumeDataProperty - the newly created VolumeDataProperty. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedata_addpropertyfromfunction(Lib3MF_VolumeData pVolumeData, const char * pName, Lib3MF_Function pTheFunction, Lib3MF_VolumeDataProperty * pTheVolumeDataProperty); + +/** +* Removes the VolumeDataProperty with a given index +* +* @param[in] pVolumeData - VolumeData instance. +* @param[in] nIndex - the index of the VolumeDataProperty to be removed. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedata_removeproperty(Lib3MF_VolumeData pVolumeData, Lib3MF_uint32 nIndex); + /************************************************************************************************************************* Class definition for Component **************************************************************************************************************************/ @@ -1973,6 +2672,144 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getlayer(Lib3MF_MultiProp */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_removelayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex); +/************************************************************************************************************************* + Class definition for Image3D +**************************************************************************************************************************/ + +/** +* returns the name of this Image3D +* +* @param[in] pImage3D - Image3D 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 this Image3D, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_image3d_getname(Lib3MF_Image3D pImage3D, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); + +/** +* sets a new name of this Image3D +* +* @param[in] pImage3D - Image3D instance. +* @param[in] pName - the new name of this Image3D +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_image3d_setname(Lib3MF_Image3D pImage3D, const char * pName); + +/** +* Retrieves, if this Image3D is a ImageStack +* +* @param[in] pImage3D - Image3D instance. +* @param[out] pIsImageStack - returns, whether the Image3D is an ImageStack +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_image3d_isimagestack(Lib3MF_Image3D pImage3D, bool * pIsImageStack); + +/************************************************************************************************************************* + Class definition for ImageStack +**************************************************************************************************************************/ + +/** +* Retrieves the number of rows in each image of this image3d +* +* @param[in] pImageStack - ImageStack instance. +* @param[out] pRowCount - number of rows +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_imagestack_getrowcount(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 * pRowCount); + +/** +* Sets the number of rows in each image of this image3d +* +* @param[in] pImageStack - ImageStack instance. +* @param[in] nRowCount - number of rows +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_imagestack_setrowcount(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nRowCount); + +/** +* Retrieves the number of columns in each image of this image3d +* +* @param[in] pImageStack - ImageStack instance. +* @param[out] pColumnCount - number of columns +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_imagestack_getcolumncount(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 * pColumnCount); + +/** +* Sets the number of columns in each image of this image3d +* +* @param[in] pImageStack - ImageStack instance. +* @param[in] nColumnCount - number of columns +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_imagestack_setcolumncount(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nColumnCount); + +/** +* Retrieves the number of images in the stack. +* +* @param[in] pImageStack - ImageStack instance. +* @param[out] pSheetCount - number of images +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_imagestack_getsheetcount(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 * pSheetCount); + +/** +* Retrieves a sheet of the stack. Raises an error if sheet is not set. +* +* @param[in] pImageStack - ImageStack instance. +* @param[in] nIndex - index of the image (0-based) +* @param[out] pSheet - attachment containing the image +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_imagestack_getsheet(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nIndex, Lib3MF_Attachment * pSheet); + +/** +* Sets a sheet to an existing attachment. +* +* @param[in] pImageStack - ImageStack instance. +* @param[in] nIndex - index of the image (0-based) +* @param[in] pSheet - attachment containing the image +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_imagestack_setsheet(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nIndex, Lib3MF_Attachment pSheet); + +/** +* Creates a new sheet attachment with empty data. +* +* @param[in] pImageStack - ImageStack instance. +* @param[in] nIndex - index of the image (0-based) +* @param[in] pPath - path of part in the package +* @param[out] pSheet - attachment containing the image +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_imagestack_createemptysheet(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nIndex, const char * pPath, Lib3MF_Attachment * pSheet); + +/** +* Creates a new sheet attachment from a memory buffer. +* +* @param[in] pImageStack - ImageStack instance. +* @param[in] nIndex - index of the image (0-based) +* @param[in] pPath - path of part in the package +* @param[in] nDataBufferSize - Number of elements in buffer +* @param[in] pDataBuffer - uint8 buffer of binary image data +* @param[out] pSheet - attachment containing the image +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_imagestack_createsheetfrombuffer(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nIndex, const char * pPath, Lib3MF_uint64 nDataBufferSize, const Lib3MF_uint8 * pDataBuffer, Lib3MF_Attachment * pSheet); + +/** +* Creates a new sheet attachment from a file on disk. +* +* @param[in] pImageStack - ImageStack instance. +* @param[in] nIndex - index of the image (0-based) +* @param[in] pPath - path of part in the package +* @param[in] pFileName - file name to read from +* @param[out] pSheet - attachment containing the image +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_imagestack_createsheetfromfile(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nIndex, const char * pPath, const char * pFileName, Lib3MF_Attachment * pSheet); + /************************************************************************************************************************* Class definition for Attachment **************************************************************************************************************************/ @@ -2036,7 +2873,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_setrelationshiptype(Lib3MF_Attach 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 packege, or via the WriteToFile or WriteToBuffer-methods. +* 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. @@ -2045,7 +2882,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetofile(Lib3MF_Attachment pAt LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfromfile(Lib3MF_Attachment pAttachment, const char * pFileName); /** -* Reads a model and from the data provided by a callback function +* 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 @@ -2077,7 +2914,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getstreamsize(Lib3MF_Attachment p 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 +* Reads an attachment from a memory buffer. This buffer is immediately read (in contrast to the ReadFromCallback and ReadFromFile-methods). * * @param[in] pAttachment - Attachment instance. * @param[in] nBufferBufferSize - Number of elements in buffer @@ -2164,6 +3001,2233 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_getfilter(Lib3MF_Texture2D pTextur */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_setfilter(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureFilter eFilter); +/************************************************************************************************************************* + Class definition for ImplicitPort +**************************************************************************************************************************/ + +/** +* Retrieves the identifier of the port +* +* @param[in] pImplicitPort - ImplicitPort 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 the identifier, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitport_getidentifier(Lib3MF_ImplicitPort pImplicitPort, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer); + +/** +* Sets the identifier of the port +* +* @param[in] pImplicitPort - ImplicitPort instance. +* @param[in] pIdentifier - the identifier +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitport_setidentifier(Lib3MF_ImplicitPort pImplicitPort, const char * pIdentifier); + +/** +* Retrieves the display name of the port +* +* @param[in] pImplicitPort - ImplicitPort instance. +* @param[in] nDisplayNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pDisplayNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pDisplayNameBuffer - buffer of the display name, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitport_getdisplayname(Lib3MF_ImplicitPort pImplicitPort, const Lib3MF_uint32 nDisplayNameBufferSize, Lib3MF_uint32* pDisplayNameNeededChars, char * pDisplayNameBuffer); + +/** +* Sets the display name of the port +* +* @param[in] pImplicitPort - ImplicitPort instance. +* @param[in] pDisplayName - the display name +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitport_setdisplayname(Lib3MF_ImplicitPort pImplicitPort, const char * pDisplayName); + +/** +* Sets the type of the port +* +* @param[in] pImplicitPort - ImplicitPort instance. +* @param[in] eImplicitPortType - the type +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitport_settype(Lib3MF_ImplicitPort pImplicitPort, Lib3MF::eImplicitPortType eImplicitPortType); + +/** +* Retrieves the type of the port +* +* @param[in] pImplicitPort - ImplicitPort instance. +* @param[out] pImplicitPortType - the type +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitport_gettype(Lib3MF_ImplicitPort pImplicitPort, Lib3MF::eImplicitPortType * pImplicitPortType); + +/** +* Retrieves the reference of the port, only used for input ports +* +* @param[in] pImplicitPort - ImplicitPort instance. +* @param[in] nReferenceBufferSize - size of the buffer (including trailing 0) +* @param[out] pReferenceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pReferenceBuffer - buffer of the reference, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitport_getreference(Lib3MF_ImplicitPort pImplicitPort, const Lib3MF_uint32 nReferenceBufferSize, Lib3MF_uint32* pReferenceNeededChars, char * pReferenceBuffer); + +/** +* Sets the reference of the port, only used for input ports +* +* @param[in] pImplicitPort - ImplicitPort instance. +* @param[in] pReference - the reference +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitport_setreference(Lib3MF_ImplicitPort pImplicitPort, const char * pReference); + +/************************************************************************************************************************* + Class definition for Iterator +**************************************************************************************************************************/ + +/** +* Iterates to the next item in the list. +* +* @param[in] pIterator - Iterator instance. +* @param[out] pHasNext - Iterates to the next item in the list. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_iterator_movenext(Lib3MF_Iterator pIterator, bool * pHasNext); + +/** +* Iterates to the previous item in the list. +* +* @param[in] pIterator - Iterator instance. +* @param[out] pHasPrevious - Iterates to the previous item in the list. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_iterator_moveprevious(Lib3MF_Iterator pIterator, bool * pHasPrevious); + +/** +* Returns the number of items the iterator captures. +* +* @param[in] pIterator - Iterator instance. +* @param[out] pCount - returns the number of items the iterator captures. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_iterator_count(Lib3MF_Iterator pIterator, Lib3MF_uint64 * pCount); + +/************************************************************************************************************************* + Class definition for ImplicitPortIterator +**************************************************************************************************************************/ + +/** +* Returns the current element +* +* @param[in] pImplicitPortIterator - ImplicitPortIterator instance. +* @param[out] pPort - The current element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitportiterator_getcurrent(Lib3MF_ImplicitPortIterator pImplicitPortIterator, Lib3MF_ImplicitPort * pPort); + +/************************************************************************************************************************* + Class definition for ImplicitNode +**************************************************************************************************************************/ + +/** +* Retrieves the identifier of the node +* +* @param[in] pImplicitNode - ImplicitNode 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 the identifier, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitnode_getidentifier(Lib3MF_ImplicitNode pImplicitNode, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer); + +/** +* Sets the identifier of the node +* +* @param[in] pImplicitNode - ImplicitNode instance. +* @param[in] pIdentifier - the identifier +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitnode_setidentifier(Lib3MF_ImplicitNode pImplicitNode, const char * pIdentifier); + +/** +* Retrieves the display name of the node +* +* @param[in] pImplicitNode - ImplicitNode instance. +* @param[in] nDisplayNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pDisplayNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pDisplayNameBuffer - buffer of the display name, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitnode_getdisplayname(Lib3MF_ImplicitNode pImplicitNode, const Lib3MF_uint32 nDisplayNameBufferSize, Lib3MF_uint32* pDisplayNameNeededChars, char * pDisplayNameBuffer); + +/** +* Sets the display name of the node +* +* @param[in] pImplicitNode - ImplicitNode instance. +* @param[in] pDisplayName - the display name +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitnode_setdisplayname(Lib3MF_ImplicitNode pImplicitNode, const char * pDisplayName); + +/** +* Retrieves the tag of the node +* +* @param[in] pImplicitNode - ImplicitNode instance. +* @param[in] nTagBufferSize - size of the buffer (including trailing 0) +* @param[out] pTagNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTagBuffer - buffer of the tag, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitnode_gettag(Lib3MF_ImplicitNode pImplicitNode, const Lib3MF_uint32 nTagBufferSize, Lib3MF_uint32* pTagNeededChars, char * pTagBuffer); + +/** +* Sets the tag of the node +* +* @param[in] pImplicitNode - ImplicitNode instance. +* @param[in] pTag - the tag +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitnode_settag(Lib3MF_ImplicitNode pImplicitNode, const char * pTag); + +/** +* Retrieves the type of the node +* +* @param[in] pImplicitNode - ImplicitNode instance. +* @param[out] pType - the type of the node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitnode_getnodetype(Lib3MF_ImplicitNode pImplicitNode, Lib3MF::eImplicitNodeType * pType); + +/** +* Add an input +* +* @param[in] pImplicitNode - ImplicitNode instance. +* @param[in] pIdentifier - the identifier of the input +* @param[in] pDisplayName - the display name of the input +* @param[out] pPort - +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitnode_addinput(Lib3MF_ImplicitNode pImplicitNode, const char * pIdentifier, const char * pDisplayName, Lib3MF_ImplicitPort * pPort); + +/** +* Retrieves the inputs +* +* @param[in] pImplicitNode - ImplicitNode instance. +* @param[out] pIterator - the iterator for the inputs +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitnode_getinputs(Lib3MF_ImplicitNode pImplicitNode, Lib3MF_ImplicitPortIterator * pIterator); + +/** +* Add an output +* +* @param[in] pImplicitNode - ImplicitNode instance. +* @param[in] pIdentifier - the identifier of the output +* @param[in] pDisplayName - the display name of the output +* @param[out] pPort - +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitnode_addoutput(Lib3MF_ImplicitNode pImplicitNode, const char * pIdentifier, const char * pDisplayName, Lib3MF_ImplicitPort * pPort); + +/** +* Retrieves the outputs +* +* @param[in] pImplicitNode - ImplicitNode instance. +* @param[out] pIterator - the iterator the outputs +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitnode_getoutputs(Lib3MF_ImplicitNode pImplicitNode, Lib3MF_ImplicitPortIterator * pIterator); + +/** +* Retrieves an input +* +* @param[in] pImplicitNode - ImplicitNode instance. +* @param[in] pIdentifier - the identifier of the input +* @param[out] pInput - the input port +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitnode_findinput(Lib3MF_ImplicitNode pImplicitNode, const char * pIdentifier, Lib3MF_ImplicitPort * pInput); + +/** +* Retrieves an output +* +* @param[in] pImplicitNode - ImplicitNode instance. +* @param[in] pIdentifier - the identifier of the output +* @param[out] pOutput - the output port +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitnode_findoutput(Lib3MF_ImplicitNode pImplicitNode, const char * pIdentifier, Lib3MF_ImplicitPort * pOutput); + +/** +* Checks if the types of the input and output ports are valid for the node type +* +* @param[in] pImplicitNode - ImplicitNode instance. +* @param[out] pValid - true, if the types are valid +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitnode_aretypesvalid(Lib3MF_ImplicitNode pImplicitNode, bool * pValid); + +/************************************************************************************************************************* + Class definition for OneInputNode +**************************************************************************************************************************/ + +/** +* Retrieves the input +* +* @param[in] pOneInputNode - OneInputNode instance. +* @param[out] pInput - the input +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_oneinputnode_getinputa(Lib3MF_OneInputNode pOneInputNode, Lib3MF_ImplicitPort * pInput); + +/** +* Retrieves the output +* +* @param[in] pOneInputNode - OneInputNode instance. +* @param[out] pResult - the output +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_oneinputnode_getoutputresult(Lib3MF_OneInputNode pOneInputNode, Lib3MF_ImplicitPort * pResult); + +/************************************************************************************************************************* + Class definition for SinNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for CosNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for TanNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for ArcSinNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for ArcCosNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for ArcTanNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for SinhNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for CoshNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for TanhNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for RoundNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for CeilNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for FloorNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for SignNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for FractNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for AbsNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for ExpNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for LogNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for Log2Node +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for Log10Node +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for LengthNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for TransposeNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for InverseNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for SqrtNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for ResourceIdNode +**************************************************************************************************************************/ + +/** +* Sets the Resource that the resourceid attribute of the node will point to +* +* @param[in] pResourceIdNode - ResourceIdNode instance. +* @param[in] pResource - the resource +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_resourceidnode_setresource(Lib3MF_ResourceIdNode pResourceIdNode, Lib3MF_Resource pResource); + +/** +* Retrieves the resource of the node +* +* @param[in] pResourceIdNode - ResourceIdNode instance. +* @param[out] pResource - the resource +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_resourceidnode_getresource(Lib3MF_ResourceIdNode pResourceIdNode, Lib3MF_Resource * pResource); + +/** +* Retrieves the output +* +* @param[in] pResourceIdNode - ResourceIdNode instance. +* @param[out] pValue - the output +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_resourceidnode_getoutputvalue(Lib3MF_ResourceIdNode pResourceIdNode, Lib3MF_ImplicitPort * pValue); + +/************************************************************************************************************************* + Class definition for TwoInputNode +**************************************************************************************************************************/ + +/** +* Retrieves the second input +* +* @param[in] pTwoInputNode - TwoInputNode instance. +* @param[out] pB - the second input +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_twoinputnode_getinputb(Lib3MF_TwoInputNode pTwoInputNode, Lib3MF_ImplicitPort * pB); + +/************************************************************************************************************************* + Class definition for AdditionNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for SubtractionNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for MultiplicationNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for DivisionNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for DotNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for CrossNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for ArcTan2Node +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for MatVecMultiplicationNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for MinNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for MaxNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for FmodNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for ModNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for PowNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for SelectNode +**************************************************************************************************************************/ + +/** +* Retrieves the second input +* +* @param[in] pSelectNode - SelectNode instance. +* @param[out] pB - the second input +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_selectnode_getinputb(Lib3MF_SelectNode pSelectNode, Lib3MF_ImplicitPort * pB); + +/** +* Retrieves the third input +* +* @param[in] pSelectNode - SelectNode instance. +* @param[out] pC - the third input +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_selectnode_getinputc(Lib3MF_SelectNode pSelectNode, Lib3MF_ImplicitPort * pC); + +/** +* Retrieves the fourth input +* +* @param[in] pSelectNode - SelectNode instance. +* @param[out] pD - the fourth input +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_selectnode_getinputd(Lib3MF_SelectNode pSelectNode, Lib3MF_ImplicitPort * pD); + +/************************************************************************************************************************* + Class definition for ClampNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the lower limit +* +* @param[in] pClampNode - ClampNode instance. +* @param[out] pMin - the input for the lower limit +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_clampnode_getinputmin(Lib3MF_ClampNode pClampNode, Lib3MF_ImplicitPort * pMin); + +/** +* Retrieves the input for the upper limit +* +* @param[in] pClampNode - ClampNode instance. +* @param[out] pMax - the input for the upper limit +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_clampnode_getinputmax(Lib3MF_ClampNode pClampNode, Lib3MF_ImplicitPort * pMax); + +/************************************************************************************************************************* + Class definition for ComposeVectorNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the x component +* +* @param[in] pComposeVectorNode - ComposeVectorNode instance. +* @param[out] pX - the input for the x component +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composevectornode_getinputx(Lib3MF_ComposeVectorNode pComposeVectorNode, Lib3MF_ImplicitPort * pX); + +/** +* Retrieves the input for the y component +* +* @param[in] pComposeVectorNode - ComposeVectorNode instance. +* @param[out] pY - the input for the y component +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composevectornode_getinputy(Lib3MF_ComposeVectorNode pComposeVectorNode, Lib3MF_ImplicitPort * pY); + +/** +* Retrieves the input for the z component +* +* @param[in] pComposeVectorNode - ComposeVectorNode instance. +* @param[out] pZ - the input for the z component +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composevectornode_getinputz(Lib3MF_ComposeVectorNode pComposeVectorNode, Lib3MF_ImplicitPort * pZ); + +/** +* Retrieves the output +* +* @param[in] pComposeVectorNode - ComposeVectorNode instance. +* @param[out] pResult - the output +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composevectornode_getoutputresult(Lib3MF_ComposeVectorNode pComposeVectorNode, Lib3MF_ImplicitPort * pResult); + +/************************************************************************************************************************* + Class definition for VectorFromScalarNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class definition for DecomposeVectorNode +**************************************************************************************************************************/ + +/** +* Retrieves the input +* +* @param[in] pDecomposeVectorNode - DecomposeVectorNode instance. +* @param[out] pA - the input port for the vector to decompose +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_decomposevectornode_getinputa(Lib3MF_DecomposeVectorNode pDecomposeVectorNode, Lib3MF_ImplicitPort * pA); + +/** +* Retrieves the output for the x component +* +* @param[in] pDecomposeVectorNode - DecomposeVectorNode instance. +* @param[out] pX - the output for the x component +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_decomposevectornode_getoutputx(Lib3MF_DecomposeVectorNode pDecomposeVectorNode, Lib3MF_ImplicitPort * pX); + +/** +* Retrieves the output for the y component +* +* @param[in] pDecomposeVectorNode - DecomposeVectorNode instance. +* @param[out] pY - the output for the y component +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_decomposevectornode_getoutputy(Lib3MF_DecomposeVectorNode pDecomposeVectorNode, Lib3MF_ImplicitPort * pY); + +/** +* Retrieves the output for the z component +* +* @param[in] pDecomposeVectorNode - DecomposeVectorNode instance. +* @param[out] pZ - the output for the z component +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_decomposevectornode_getoutputz(Lib3MF_DecomposeVectorNode pDecomposeVectorNode, Lib3MF_ImplicitPort * pZ); + +/************************************************************************************************************************* + Class definition for ComposeMatrixNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the element 0 0 +* +* @param[in] pComposeMatrixNode - ComposeMatrixNode instance. +* @param[out] pM00 - the input for the m00 element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composematrixnode_getinputm00(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM00); + +/** +* Retrieves the input for the element 0 1 +* +* @param[in] pComposeMatrixNode - ComposeMatrixNode instance. +* @param[out] pM01 - the input for the m01 element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composematrixnode_getinputm01(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM01); + +/** +* Retrieves the input for the element 0 2 +* +* @param[in] pComposeMatrixNode - ComposeMatrixNode instance. +* @param[out] pM02 - the input for the m02 element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composematrixnode_getinputm02(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM02); + +/** +* Retrieves the input for the element 0 3 +* +* @param[in] pComposeMatrixNode - ComposeMatrixNode instance. +* @param[out] pM03 - the input for the m03 element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composematrixnode_getinputm03(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM03); + +/** +* Retrieves the input for the element 1 0 +* +* @param[in] pComposeMatrixNode - ComposeMatrixNode instance. +* @param[out] pM10 - the input for the m10 element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composematrixnode_getinputm10(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM10); + +/** +* Retrieves the input for the element 1 1 +* +* @param[in] pComposeMatrixNode - ComposeMatrixNode instance. +* @param[out] pM11 - the input for the m11 element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composematrixnode_getinputm11(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM11); + +/** +* Retrieves the input for the element 1 2 +* +* @param[in] pComposeMatrixNode - ComposeMatrixNode instance. +* @param[out] pM12 - the input for the m12 element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composematrixnode_getinputm12(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM12); + +/** +* Retrieves the input for the element 1 3 +* +* @param[in] pComposeMatrixNode - ComposeMatrixNode instance. +* @param[out] pM13 - the input for the m13 element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composematrixnode_getinputm13(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM13); + +/** +* Retrieves the input for the element 2 0 +* +* @param[in] pComposeMatrixNode - ComposeMatrixNode instance. +* @param[out] pM20 - the input for the m20 element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composematrixnode_getinputm20(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM20); + +/** +* Retrieves the input for the element 2 1 +* +* @param[in] pComposeMatrixNode - ComposeMatrixNode instance. +* @param[out] pM21 - +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composematrixnode_getinputm21(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM21); + +/** +* Retrieves the input for the element 2 2 +* +* @param[in] pComposeMatrixNode - ComposeMatrixNode instance. +* @param[out] pM22 - the input for the m22 element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composematrixnode_getinputm22(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM22); + +/** +* Retrieves the input for the element 2 3 +* +* @param[in] pComposeMatrixNode - ComposeMatrixNode instance. +* @param[out] pM23 - the input for the m23 element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composematrixnode_getinputm23(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM23); + +/** +* Retrieves the input for the element 3 0 +* +* @param[in] pComposeMatrixNode - ComposeMatrixNode instance. +* @param[out] pM30 - the input for the m30 element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composematrixnode_getinputm30(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM30); + +/** +* Retrieves the input for the element 3 1 +* +* @param[in] pComposeMatrixNode - ComposeMatrixNode instance. +* @param[out] pM31 - the input for the m31 element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composematrixnode_getinputm31(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM31); + +/** +* Retrieves the input for the element 3 2 +* +* @param[in] pComposeMatrixNode - ComposeMatrixNode instance. +* @param[out] pM32 - the input for the m32 element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composematrixnode_getinputm32(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM32); + +/** +* Retrieves the input for the element 3 3 +* +* @param[in] pComposeMatrixNode - ComposeMatrixNode instance. +* @param[out] pM33 - the input for the m33 element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composematrixnode_getinputm33(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM33); + +/** +* Retrieves the output +* +* @param[in] pComposeMatrixNode - ComposeMatrixNode instance. +* @param[out] pResult - the output +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_composematrixnode_getoutputresult(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pResult); + +/************************************************************************************************************************* + Class definition for MatrixFromRowsNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the first row +* +* @param[in] pMatrixFromRowsNode - MatrixFromRowsNode instance. +* @param[out] pRow0 - the input for the first row +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_matrixfromrowsnode_getinputa(Lib3MF_MatrixFromRowsNode pMatrixFromRowsNode, Lib3MF_ImplicitPort * pRow0); + +/** +* Retrieves the input for the second row +* +* @param[in] pMatrixFromRowsNode - MatrixFromRowsNode instance. +* @param[out] pRow1 - the input for the second row +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_matrixfromrowsnode_getinputb(Lib3MF_MatrixFromRowsNode pMatrixFromRowsNode, Lib3MF_ImplicitPort * pRow1); + +/** +* Retrieves the input for the third row +* +* @param[in] pMatrixFromRowsNode - MatrixFromRowsNode instance. +* @param[out] pRow2 - the input for the third row +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_matrixfromrowsnode_getinputc(Lib3MF_MatrixFromRowsNode pMatrixFromRowsNode, Lib3MF_ImplicitPort * pRow2); + +/** +* Retrieves the input for the fourth row +* +* @param[in] pMatrixFromRowsNode - MatrixFromRowsNode instance. +* @param[out] pRow3 - the input for the fourth row +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_matrixfromrowsnode_getinputd(Lib3MF_MatrixFromRowsNode pMatrixFromRowsNode, Lib3MF_ImplicitPort * pRow3); + +/** +* Retrieves the output +* +* @param[in] pMatrixFromRowsNode - MatrixFromRowsNode instance. +* @param[out] pResult - the output +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_matrixfromrowsnode_getoutputresult(Lib3MF_MatrixFromRowsNode pMatrixFromRowsNode, Lib3MF_ImplicitPort * pResult); + +/************************************************************************************************************************* + Class definition for MatrixFromColumnsNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the first column +* +* @param[in] pMatrixFromColumnsNode - MatrixFromColumnsNode instance. +* @param[out] pColumn0 - the input for the first column +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_matrixfromcolumnsnode_getinputa(Lib3MF_MatrixFromColumnsNode pMatrixFromColumnsNode, Lib3MF_ImplicitPort * pColumn0); + +/** +* Retrieves the input for the second column +* +* @param[in] pMatrixFromColumnsNode - MatrixFromColumnsNode instance. +* @param[out] pColumn1 - the input for the second column +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_matrixfromcolumnsnode_getinputb(Lib3MF_MatrixFromColumnsNode pMatrixFromColumnsNode, Lib3MF_ImplicitPort * pColumn1); + +/** +* Retrieves the input for the third column +* +* @param[in] pMatrixFromColumnsNode - MatrixFromColumnsNode instance. +* @param[out] pColumn2 - the input for the third column +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_matrixfromcolumnsnode_getinputc(Lib3MF_MatrixFromColumnsNode pMatrixFromColumnsNode, Lib3MF_ImplicitPort * pColumn2); + +/** +* Retrieves the input for the fourth column +* +* @param[in] pMatrixFromColumnsNode - MatrixFromColumnsNode instance. +* @param[out] pColumn3 - the input for the fourth column +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_matrixfromcolumnsnode_getinputd(Lib3MF_MatrixFromColumnsNode pMatrixFromColumnsNode, Lib3MF_ImplicitPort * pColumn3); + +/** +* Retrieves the output +* +* @param[in] pMatrixFromColumnsNode - MatrixFromColumnsNode instance. +* @param[out] pResult - the output +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_matrixfromcolumnsnode_getoutputresult(Lib3MF_MatrixFromColumnsNode pMatrixFromColumnsNode, Lib3MF_ImplicitPort * pResult); + +/************************************************************************************************************************* + Class definition for ConstantNode +**************************************************************************************************************************/ + +/** +* Sets the constant value of the node +* +* @param[in] pConstantNode - ConstantNode instance. +* @param[in] dValue - the value +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_constantnode_setconstant(Lib3MF_ConstantNode pConstantNode, Lib3MF_double dValue); + +/** +* Retrieves the constant value of the node +* +* @param[in] pConstantNode - ConstantNode instance. +* @param[out] pValue - the value +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_constantnode_getconstant(Lib3MF_ConstantNode pConstantNode, Lib3MF_double * pValue); + +/** +* Retrieves the output +* +* @param[in] pConstantNode - ConstantNode instance. +* @param[out] pValue - the output +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_constantnode_getoutputvalue(Lib3MF_ConstantNode pConstantNode, Lib3MF_ImplicitPort * pValue); + +/************************************************************************************************************************* + Class definition for ConstVecNode +**************************************************************************************************************************/ + +/** +* Sets the vector value of the node +* +* @param[in] pConstVecNode - ConstVecNode instance. +* @param[in] pValue - the value +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_constvecnode_setvector(Lib3MF_ConstVecNode pConstVecNode, const Lib3MF::sVector * pValue); + +/** +* Retrieves the vector value of the node +* +* @param[in] pConstVecNode - ConstVecNode instance. +* @param[out] pValue - the value +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_constvecnode_getvector(Lib3MF_ConstVecNode pConstVecNode, Lib3MF::sVector * pValue); + +/** +* Retrieves the output +* +* @param[in] pConstVecNode - ConstVecNode instance. +* @param[out] pVector - the output +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_constvecnode_getoutputvector(Lib3MF_ConstVecNode pConstVecNode, Lib3MF_ImplicitPort * pVector); + +/************************************************************************************************************************* + Class definition for ConstMatNode +**************************************************************************************************************************/ + +/** +* Sets the matrix value of the node +* +* @param[in] pConstMatNode - ConstMatNode instance. +* @param[in] pValue - the value +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_constmatnode_setmatrix(Lib3MF_ConstMatNode pConstMatNode, const Lib3MF::sMatrix4x4 * pValue); + +/** +* Retrieves the matrix value of the node +* +* @param[in] pConstMatNode - ConstMatNode instance. +* @param[out] pValue - the matrix +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_constmatnode_getmatrix(Lib3MF_ConstMatNode pConstMatNode, Lib3MF::sMatrix4x4 * pValue); + +/** +* Retrieves the output +* +* @param[in] pConstMatNode - ConstMatNode instance. +* @param[out] pMatrix - the output +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_constmatnode_getoutputmatrix(Lib3MF_ConstMatNode pConstMatNode, Lib3MF_ImplicitPort * pMatrix); + +/************************************************************************************************************************* + Class definition for MeshNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the model resource id of the mesh +* +* @param[in] pMeshNode - MeshNode instance. +* @param[out] pMesh - the input port for the model resource id of the mesh +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshnode_getinputmesh(Lib3MF_MeshNode pMeshNode, Lib3MF_ImplicitPort * pMesh); + +/** +* Retrieves the input for the position +* +* @param[in] pMeshNode - MeshNode instance. +* @param[out] pPos - the input port for the position +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshnode_getinputpos(Lib3MF_MeshNode pMeshNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the output +* +* @param[in] pMeshNode - MeshNode instance. +* @param[out] pDistance - the output port for the signed distance to the mesh +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshnode_getoutputdistance(Lib3MF_MeshNode pMeshNode, Lib3MF_ImplicitPort * pDistance); + +/************************************************************************************************************************* + Class definition for UnsignedMeshNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the model resource id of the mesh +* +* @param[in] pUnsignedMeshNode - UnsignedMeshNode instance. +* @param[out] pMesh - the input port for the model resource id of the mesh +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_unsignedmeshnode_getinputmesh(Lib3MF_UnsignedMeshNode pUnsignedMeshNode, Lib3MF_ImplicitPort * pMesh); + +/** +* Retrieves the input for the position +* +* @param[in] pUnsignedMeshNode - UnsignedMeshNode instance. +* @param[out] pPos - the input port for the position +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_unsignedmeshnode_getinputpos(Lib3MF_UnsignedMeshNode pUnsignedMeshNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the output +* +* @param[in] pUnsignedMeshNode - UnsignedMeshNode instance. +* @param[out] pDistance - the output port for the unsigned distance to the mesh +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_unsignedmeshnode_getoutputdistance(Lib3MF_UnsignedMeshNode pUnsignedMeshNode, Lib3MF_ImplicitPort * pDistance); + +/************************************************************************************************************************* + Class definition for BeamLatticeNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the model resource id of the beam lattice +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pBeamLattice - the input port for the model resource id of the beam lattice (mesh with beamlattice extension) +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_getinputbeamlattice(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pBeamLattice); + +/** +* Retrieves the input for the position +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pPos - the input port for the position +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_getinputpos(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the output +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pDistance - the output port for the signed distance to the beam lattice +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_getoutputdistance(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pDistance); + +/** +* Sets the accurate range for distance computation +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[in] dAccurateRange - the accurate range in model units +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_setaccuraterange(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double dAccurateRange); + +/** +* Retrieves the accurate range for distance computation +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pAccurateRange - the accurate range in model units +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_getaccuraterange(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double * pAccurateRange); + +/************************************************************************************************************************* + Class definition for FunctionGradientNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the function id +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pFunction - the input port for the function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getinputfunctionid(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pFunction); + +/** +* Retrieves the input for the position +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pPos - the input port for the position +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getinputpos(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the input for the finite difference step +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pStep - the input port for the finite difference step +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getinputstep(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pStep); + +/** +* Sets the name of the referenced scalar output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] pScalarOutputName - the name of the scalar output of the referenced function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_setscalaroutputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pScalarOutputName); + +/** +* Retrieves the name of the referenced scalar output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] nScalarOutputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pScalarOutputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pScalarOutputNameBuffer - buffer of the name of the scalar output of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getscalaroutputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer); + +/** +* Sets the name of the referenced vector input +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] pVectorInputName - the name of the vector input (float3) of the referenced function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_setvectorinputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pVectorInputName); + +/** +* Retrieves the name of the referenced vector input +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] nVectorInputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pVectorInputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pVectorInputNameBuffer - buffer of the name of the vector input (float3) of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getvectorinputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer); + +/** +* Retrieves the normalized gradient output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pNormalizedGradient - the output port for the normalized gradient +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getoutputnormalizedgradient(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pNormalizedGradient); + +/** +* Retrieves the raw gradient output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pGradient - the output port for the raw gradient +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getoutputgradient(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pGradient); + +/** +* Retrieves the gradient magnitude output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pMagnitude - the output port for the gradient magnitude +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getoutputmagnitude(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pMagnitude); + +/************************************************************************************************************************* + Class definition for NormalizeDistanceNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the function id +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pFunction - the input port for the function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getinputfunctionid(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pFunction); + +/** +* Retrieves the input for the position +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pPos - the input port for the position (vector) +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getinputpos(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the input for the finite difference step +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pStep - the input port for the finite difference step +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getinputstep(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pStep); + +/** +* Sets the name of the referenced scalar output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] pScalarOutputName - the name of the scalar output of the referenced function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_setscalaroutputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pScalarOutputName); + +/** +* Retrieves the name of the referenced scalar output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] nScalarOutputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pScalarOutputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pScalarOutputNameBuffer - buffer of the name of the scalar output of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getscalaroutputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer); + +/** +* Sets the name of the referenced vector input +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] pVectorInputName - the name of the vector input (float3) of the referenced function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_setvectorinputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pVectorInputName); + +/** +* Retrieves the name of the referenced vector input +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] nVectorInputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pVectorInputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pVectorInputNameBuffer - buffer of the name of the vector input (float3) of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getvectorinputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer); + +/** +* Retrieves the normalized result output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pResult - the output port for the normalized distance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getoutputresult(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pResult); + +/************************************************************************************************************************* + Class definition for FunctionCallNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the function id +* +* @param[in] pFunctionCallNode - FunctionCallNode instance. +* @param[out] pFunction - the input port for the function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functioncallnode_getinputfunctionid(Lib3MF_FunctionCallNode pFunctionCallNode, Lib3MF_ImplicitPort * pFunction); + +/************************************************************************************************************************* + Class definition for NodeIterator +**************************************************************************************************************************/ + +/** +* Returns the current element +* +* @param[in] pNodeIterator - NodeIterator instance. +* @param[out] pNode - The current element +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_nodeiterator_getcurrent(Lib3MF_NodeIterator pNodeIterator, Lib3MF_ImplicitNode * pNode); + +/************************************************************************************************************************* + Class definition for Function +**************************************************************************************************************************/ + +/** +* Retrieves the display name of the function +* +* @param[in] pFunction - Function instance. +* @param[in] nDisplayNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pDisplayNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pDisplayNameBuffer - buffer of the display name, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_function_getdisplayname(Lib3MF_Function pFunction, const Lib3MF_uint32 nDisplayNameBufferSize, Lib3MF_uint32* pDisplayNameNeededChars, char * pDisplayNameBuffer); + +/** +* Sets the display name of the function +* +* @param[in] pFunction - Function instance. +* @param[in] pDisplayName - the display name +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_function_setdisplayname(Lib3MF_Function pFunction, const char * pDisplayName); + +/** +* Add an input +* +* @param[in] pFunction - Function instance. +* @param[in] pIdentifier - the identifier of the input +* @param[in] pDisplayName - the display name of the input +* @param[in] eType - the type of the input +* @param[out] pPort - The added input port +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_function_addinput(Lib3MF_Function pFunction, const char * pIdentifier, const char * pDisplayName, Lib3MF::eImplicitPortType eType, Lib3MF_ImplicitPort * pPort); + +/** +* Retrieves the inputs +* +* @param[in] pFunction - Function instance. +* @param[out] pIterator - iterator for the list of inputs +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_function_getinputs(Lib3MF_Function pFunction, Lib3MF_ImplicitPortIterator * pIterator); + +/** +* Removes an input +* +* @param[in] pFunction - Function instance. +* @param[in] pInput - The input to be removed +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_function_removeinput(Lib3MF_Function pFunction, Lib3MF_ImplicitPort pInput); + +/** +* Add an output +* +* @param[in] pFunction - Function instance. +* @param[in] pIdentifier - the identifier of the output +* @param[in] pDisplayName - the display name of the output +* @param[in] eType - the type of the input +* @param[out] pPort - The added input port +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_function_addoutput(Lib3MF_Function pFunction, const char * pIdentifier, const char * pDisplayName, Lib3MF::eImplicitPortType eType, Lib3MF_ImplicitPort * pPort); + +/** +* Retrieves the outputs +* +* @param[in] pFunction - Function instance. +* @param[out] pIterator - iterator for the outputs +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_function_getoutputs(Lib3MF_Function pFunction, Lib3MF_ImplicitPortIterator * pIterator); + +/** +* Removes an output +* +* @param[in] pFunction - Function instance. +* @param[in] pOutput - The output to be removed +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_function_removeoutput(Lib3MF_Function pFunction, Lib3MF_ImplicitPort pOutput); + +/** +* Retrieves an input +* +* @param[in] pFunction - Function instance. +* @param[in] pIdentifier - the identifier of the input +* @param[out] pInput - the input port +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_function_findinput(Lib3MF_Function pFunction, const char * pIdentifier, Lib3MF_ImplicitPort * pInput); + +/** +* Retrieves an output +* +* @param[in] pFunction - Function instance. +* @param[in] pIdentifier - the identifier of the output +* @param[out] pOutput - the output port +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_function_findoutput(Lib3MF_Function pFunction, const char * pIdentifier, Lib3MF_ImplicitPort * pOutput); + +/************************************************************************************************************************* + Class definition for ImplicitFunction +**************************************************************************************************************************/ + +/** +* Retrieves the identifier of the function +* +* @param[in] pImplicitFunction - ImplicitFunction 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 the identifier, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_getidentifier(Lib3MF_ImplicitFunction pImplicitFunction, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer); + +/** +* Sets the identifier of the function +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_setidentifier(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier); + +/** +* Add a node +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] eNodeType - the type of the node +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addnode(Lib3MF_ImplicitFunction pImplicitFunction, Lib3MF::eImplicitNodeType eNodeType, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_ImplicitNode * pNode); + +/** +* Add a SinNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addsinnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_SinNode * pNode); + +/** +* Add a CosNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addcosnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_CosNode * pNode); + +/** +* Add a TanNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addtannode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_TanNode * pNode); + +/** +* Add a ArcSinNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addarcsinnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_ArcSinNode * pNode); + +/** +* Add a ArcCosNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addarccosnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_ArcCosNode * pNode); + +/** +* Add a ArcTan2Node +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addarctan2node(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_ArcTan2Node * pNode); + +/** +* Add a SinhNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addsinhnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_SinhNode * pNode); + +/** +* Add a CoshNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addcoshnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_CoshNode * pNode); + +/** +* Add a TanhNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addtanhnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_TanhNode * pNode); + +/** +* Add a RoundNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addroundnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_RoundNode * pNode); + +/** +* Add a CeilNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addceilnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_CeilNode * pNode); + +/** +* Add a FloorNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addfloornode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_FloorNode * pNode); + +/** +* Add a SignNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addsignnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_SignNode * pNode); + +/** +* Add a FractNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addfractnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_FractNode * pNode); + +/** +* Add a AbsNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addabsnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_AbsNode * pNode); + +/** +* Add a ExpNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addexpnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_ExpNode * pNode); + +/** +* Add a LogNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addlognode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_LogNode * pNode); + +/** +* Add a Log2Node +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addlog2node(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_Log2Node * pNode); + +/** +* Add a Log10Node +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addlog10node(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_Log10Node * pNode); + +/** +* Add a LengthNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addlengthnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_LengthNode * pNode); + +/** +* Add a TransposeNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addtransposenode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_TransposeNode * pNode); + +/** +* Add a InverseNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addinversenode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_InverseNode * pNode); + +/** +* Add a SqrtNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addsqrtnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_SqrtNode * pNode); + +/** +* Add a ResourceIdNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addresourceidnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_ResourceIdNode * pNode); + +/** +* Add an AdditionNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addadditionnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_AdditionNode * pNode); + +/** +* Add a SubtractionNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addsubtractionnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_SubtractionNode * pNode); + +/** +* Add a MultiplicationNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addmultiplicationnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_MultiplicationNode * pNode); + +/** +* Add a DivisionNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_adddivisionnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_DivisionNode * pNode); + +/** +* Add a DotNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_adddotnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_DotNode * pNode); + +/** +* Add a CrossNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addcrossnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_CrossNode * pNode); + +/** +* Add a MatVecMultiplicationNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addmatvecmultiplicationnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_MatVecMultiplicationNode * pNode); + +/** +* Add a MinNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addminnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_MinNode * pNode); + +/** +* Add a MaxNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addmaxnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_MaxNode * pNode); + +/** +* Add a FmodNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addfmodnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_FmodNode * pNode); + +/** +* Add a PowNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addpownode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_PowNode * pNode); + +/** +* Add a SelectNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addselectnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_SelectNode * pNode); + +/** +* Add a ClampNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] eConfiguration - the configuration of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addclampnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pDisplayName, const char * pTag, Lib3MF_ClampNode * pNode); + +/** +* Add a ComposeVectorNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addcomposevectornode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_ComposeVectorNode * pNode); + +/** +* Add a VectorFromScalar +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addvectorfromscalarnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_VectorFromScalarNode * pNode); + +/** +* Add a DecomposeVectorNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_adddecomposevectornode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_DecomposeVectorNode * pNode); + +/** +* Add a ComposeMatrixNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addcomposematrixnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_ComposeMatrixNode * pNode); + +/** +* Add a MatrixFromRowsNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addmatrixfromrowsnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_MatrixFromRowsNode * pNode); + +/** +* Add a MatrixFromColumnsNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addmatrixfromcolumnsnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_MatrixFromColumnsNode * pNode); + +/** +* Add a ConstantNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addconstantnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_ConstantNode * pNode); + +/** +* Add a ConstVecNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addconstvecnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_ConstVecNode * pNode); + +/** +* Add a ConstMatNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addconstmatnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_ConstMatNode * pNode); + +/** +* Add a MeshNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addmeshnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_MeshNode * pNode); + +/** +* Add a UnsignedMeshNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addunsignedmeshnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_UnsignedMeshNode * pNode); + +/** +* Add a BeamLatticeNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addbeamlatticenode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_BeamLatticeNode * pNode); + +/** +* Add a FunctionGradientNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addfunctiongradientnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_FunctionGradientNode * pNode); + +/** +* Add a NormalizeDistanceNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addnormalizedistancenode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_NormalizeDistanceNode * pNode); + +/** +* Add a FunctionCallNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addfunctioncallnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_FunctionCallNode * pNode); + +/** +* Retrieves the nodes +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[out] pIterator - iterator for the list of nodes +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_getnodes(Lib3MF_ImplicitFunction pImplicitFunction, Lib3MF_NodeIterator * pIterator); + +/** +* Removes a node +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pNode - The node to be removed +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_removenode(Lib3MF_ImplicitFunction pImplicitFunction, Lib3MF_ImplicitNode pNode); + +/** +* Add a link +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pSource - the source port +* @param[in] pTarget - the target port +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addlink(Lib3MF_ImplicitFunction pImplicitFunction, Lib3MF_ImplicitPort pSource, Lib3MF_ImplicitPort pTarget); + +/** +* Add a link +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pSource - name of the source port in the format nodename.portname +* @param[in] pTarget - name of the target port in the format nodename.portname +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addlinkbynames(Lib3MF_ImplicitFunction pImplicitFunction, const char * pSource, const char * pTarget); + +/** +* Clears the function +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_clear(Lib3MF_ImplicitFunction pImplicitFunction); + +/** +* Sorts the nodes topologically +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_sortnodestopologically(Lib3MF_ImplicitFunction pImplicitFunction); + +/************************************************************************************************************************* + Class definition for FunctionFromImage3D +**************************************************************************************************************************/ + +/** +* Returns the selected 3D image. +* +* @param[in] pFunctionFromImage3D - FunctionFromImage3D instance. +* @param[out] pImage3D - image instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionfromimage3d_getimage3d(Lib3MF_FunctionFromImage3D pFunctionFromImage3D, Lib3MF_Image3D * pImage3D); + +/** +* Sets the 3D image of the selector. +* +* @param[in] pFunctionFromImage3D - FunctionFromImage3D instance. +* @param[in] pImage3D - image instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionfromimage3d_setimage3d(Lib3MF_FunctionFromImage3D pFunctionFromImage3D, Lib3MF_Image3D pImage3D); + +/** +* Sets the texture filter of the selector. +* +* @param[in] pFunctionFromImage3D - FunctionFromImage3D instance. +* @param[in] eFilter - texture filter +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionfromimage3d_setfilter(Lib3MF_FunctionFromImage3D pFunctionFromImage3D, Lib3MF::eTextureFilter eFilter); + +/** +* Returns the texture filter of the selector. +* +* @param[in] pFunctionFromImage3D - FunctionFromImage3D instance. +* @param[out] pFilter - texture filter +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionfromimage3d_getfilter(Lib3MF_FunctionFromImage3D pFunctionFromImage3D, Lib3MF::eTextureFilter * pFilter); + +/** +* Sets the tile styles of the selector. +* +* @param[in] pFunctionFromImage3D - FunctionFromImage3D instance. +* @param[in] eTileStyleU - tile style in U +* @param[in] eTileStyleV - tile style in V +* @param[in] eTileStyleW - tile style in W +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionfromimage3d_settilestyles(Lib3MF_FunctionFromImage3D pFunctionFromImage3D, Lib3MF::eTextureTileStyle eTileStyleU, Lib3MF::eTextureTileStyle eTileStyleV, Lib3MF::eTextureTileStyle eTileStyleW); + +/** +* Retrieves the tile styles of the selector. +* +* @param[in] pFunctionFromImage3D - FunctionFromImage3D instance. +* @param[out] pTileStyleU - tile style in U +* @param[out] pTileStyleV - tile style in V +* @param[out] pTileStyleW - tile style in W +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionfromimage3d_gettilestyles(Lib3MF_FunctionFromImage3D pFunctionFromImage3D, Lib3MF::eTextureTileStyle * pTileStyleU, Lib3MF::eTextureTileStyle * pTileStyleV, Lib3MF::eTextureTileStyle * pTileStyleW); + +/** +* returns the offset value for the pixel values in the Image3D +* +* @param[in] pFunctionFromImage3D - FunctionFromImage3D instance. +* @param[out] pOffset - the offset value for the pixel values in the Image3D +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionfromimage3d_getoffset(Lib3MF_FunctionFromImage3D pFunctionFromImage3D, Lib3MF_double * pOffset); + +/** +* Sets the offset value for the pixel values in the Image3D +* +* @param[in] pFunctionFromImage3D - FunctionFromImage3D instance. +* @param[in] dOffset - the offset value for the pixel values in the Image3D +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionfromimage3d_setoffset(Lib3MF_FunctionFromImage3D pFunctionFromImage3D, Lib3MF_double dOffset); + +/** +* returns the scale value for the pixel values in the Image3D +* +* @param[in] pFunctionFromImage3D - FunctionFromImage3D instance. +* @param[out] pScale - the scale value for the pixel values in the Image3D +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionfromimage3d_getscale(Lib3MF_FunctionFromImage3D pFunctionFromImage3D, Lib3MF_double * pScale); + +/** +* Sets the scale value for the pixel values in the Image3D +* +* @param[in] pFunctionFromImage3D - FunctionFromImage3D instance. +* @param[in] dScale - the scale value for the pixel values in the Image3D +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionfromimage3d_setscale(Lib3MF_FunctionFromImage3D pFunctionFromImage3D, Lib3MF_double dScale); + /************************************************************************************************************************* Class definition for BuildItem **************************************************************************************************************************/ @@ -3024,6 +6088,16 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_querywriter(Lib3MF_Model pModel, const */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_queryreader(Lib3MF_Model pModel, const char * pReaderClass, Lib3MF_Reader * pReaderInstance); +/** +* 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) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getresourcebyid(Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_Resource * pResource); + /** * finds a model texture by its UniqueResourceID * @@ -3124,6 +6198,16 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getcolorgroupbyid(Lib3MF_Model pModel, */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getslicestackbyid(Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_SliceStack * pSliceStacInstance); +/** +* finds a level set object by its UniqueResourceID +* +* @param[in] pModel - Model instance. +* @param[in] nUniqueResourceID - UniqueResourceID +* @param[out] pLevelSetObjectInstance - returns the level set object instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getlevelsetbyid(Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_LevelSet * pLevelSetObjectInstance); + /** * returns, whether a build has a UUID and, if true, the build's UUID * @@ -3262,6 +6346,15 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getmultipropertygroups(Lib3MF_Model pM */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getslicestacks(Lib3MF_Model pModel, Lib3MF_SliceStackIterator * pResourceIterator); +/** +* creates a resource iterator instance with all image3d resources. +* +* @param[in] pModel - Model instance. +* @param[out] pResourceIterator - returns the iterator instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getimage3ds(Lib3MF_Model pModel, Lib3MF_Image3DIterator * pResourceIterator); + /** * 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. * @@ -3271,6 +6364,15 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getslicestacks(Lib3MF_Model pModel, Li */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_mergetomodel(Lib3MF_Model pModel, Lib3MF_Model * pMergedModelInstance); +/** +* Merges the given model into this model. +* +* @param[in] pModel - Model instance. +* @param[in] pModelInstance - model to be merged +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_mergefrommodel(Lib3MF_Model pModel, Lib3MF_Model pModelInstance); + /** * adds an empty mesh object to the model. * @@ -3356,6 +6458,28 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addcompositematerials(Lib3MF_Model pMo */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addmultipropertygroup(Lib3MF_Model pModel, Lib3MF_MultiPropertyGroup * pMultiPropertyGroupInstance); +/** +* creates a new 3D Image Resource +* +* @param[in] pModel - Model instance. +* @param[in] nColumnCount - the number of columns in each sheet. +* @param[in] nRowCount - the number of rows in each sheet. +* @param[in] nSheetCount - the number of sheets in the image stack. +* @param[out] pInstance - returns the new ImageStack instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addimagestack(Lib3MF_Model pModel, Lib3MF_uint32 nColumnCount, Lib3MF_uint32 nRowCount, Lib3MF_uint32 nSheetCount, Lib3MF_ImageStack * pInstance); + +/** +* finds an ImageStack object by its UniqueResourceID +* +* @param[in] pModel - Model instance. +* @param[in] nUniqueResourceID - UniqueResourceID +* @param[out] pImageStackInstance - returns the image stack instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getimagestackbyid(Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_ImageStack * pImageStackInstance); + /** * adds a build item to the model. * @@ -3507,6 +6631,70 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_setrandomnumbercallback(Lib3MF_Model p */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getkeystore(Lib3MF_Model pModel, Lib3MF_KeyStore * pKeyStore); +/** +* creates a resource iterator for all functions +* +* @param[in] pModel - Model instance. +* @param[out] pTheResourceIterator - returns the resource iterator +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getfunctions(Lib3MF_Model pModel, Lib3MF_FunctionIterator * pTheResourceIterator); + +/** +* adds a function described by nodes to the model +* +* @param[in] pModel - Model instance. +* @param[out] pFunctionInstance - returns the function instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addimplicitfunction(Lib3MF_Model pModel, Lib3MF_ImplicitFunction * pFunctionInstance); + +/** +* adds a function defined by an image3d to the model +* +* @param[in] pModel - Model instance. +* @param[in] pImage3DInstance - the Image3D-instance used for this function +* @param[out] pFunctionInstance - returns the function instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addfunctionfromimage3d(Lib3MF_Model pModel, Lib3MF_Image3D pImage3DInstance, Lib3MF_FunctionFromImage3D * pFunctionInstance); + +/** +* adds a volume data resource to the model. +* +* @param[in] pModel - Model instance. +* @param[out] pVolumeDataInstance - returns the new volume data instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addvolumedata(Lib3MF_Model pModel, Lib3MF_VolumeData * pVolumeDataInstance); + +/** +* adds an empty boundary shape object to the model. +* +* @param[in] pModel - Model instance. +* @param[out] pLevelSetInstance - returns the mesh object instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addlevelset(Lib3MF_Model pModel, Lib3MF_LevelSet * pLevelSetInstance); + +/** +* creates a resource iterator instance with all boundary shape resources. +* +* @param[in] pModel - Model instance. +* @param[out] pResourceIterator - returns the iterator instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getlevelsets(Lib3MF_Model pModel, Lib3MF_LevelSetIterator * pResourceIterator); + +/** +* Removes a resource from the model +* +* @param[in] pModel - Model instance. +* @param[in] pResource - The resource to remove +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_removeresource(Lib3MF_Model pModel, Lib3MF_Resource pResource); + /************************************************************************************************************************* Global functions **************************************************************************************************************************/ @@ -3705,7 +6893,9 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_getscaletransform(Lib3MF_single fFactorX, Li */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_gettranslationtransform(Lib3MF_single fVectorX, Lib3MF_single fVectorY, Lib3MF_single fVectorZ, Lib3MF::sTransform * pTransform); +#ifdef __cplusplus } +#endif #endif // __LIB3MF_HEADER_CPP diff --git a/lib3mf/Include/lib3mf_implicit.hpp b/lib3mf/Include/lib3mf_implicit.hpp index 1344a19..d422116 100644 --- a/lib3mf/Include/lib3mf_implicit.hpp +++ b/lib3mf/Include/lib3mf_implicit.hpp @@ -1,6 +1,6 @@ /*++ -Copyright (C) 2019 3MF Consortium (Original Author) +Copyright (C) 2024 3MF Consortium (Original Author) All rights reserved. @@ -24,12 +24,12 @@ 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. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.6.0. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++-Header file in order to allow an easy use of the 3MF Library -Interface version: 2.2.0 +Interface version: 2.5.0 */ @@ -45,6 +45,7 @@ Interface version: 2.2.0 #else // _WIN32 #include #endif // _WIN32 +#include #include #include #include @@ -72,11 +73,22 @@ class CColorGroupIterator; class CTexture2DGroupIterator; class CCompositeMaterialsIterator; class CMultiPropertyGroupIterator; +class CImage3DIterator; +class CFunctionIterator; +class CLevelSetIterator; class CMetaData; class CMetaDataGroup; +class CTriangleSet; class CObject; class CMeshObject; +class CLevelSet; class CBeamLattice; +class CFunctionReference; +class CVolumeDataColor; +class CMaterialMapping; +class CVolumeDataComposite; +class CVolumeDataProperty; +class CVolumeData; class CComponent; class CComponentsObject; class CBeamSet; @@ -85,8 +97,74 @@ class CColorGroup; class CTexture2DGroup; class CCompositeMaterials; class CMultiPropertyGroup; +class CImage3D; +class CImageStack; class CAttachment; class CTexture2D; +class CImplicitPort; +class CIterator; +class CImplicitPortIterator; +class CImplicitNode; +class COneInputNode; +class CSinNode; +class CCosNode; +class CTanNode; +class CArcSinNode; +class CArcCosNode; +class CArcTanNode; +class CSinhNode; +class CCoshNode; +class CTanhNode; +class CRoundNode; +class CCeilNode; +class CFloorNode; +class CSignNode; +class CFractNode; +class CAbsNode; +class CExpNode; +class CLogNode; +class CLog2Node; +class CLog10Node; +class CLengthNode; +class CTransposeNode; +class CInverseNode; +class CSqrtNode; +class CResourceIdNode; +class CTwoInputNode; +class CAdditionNode; +class CSubtractionNode; +class CMultiplicationNode; +class CDivisionNode; +class CDotNode; +class CCrossNode; +class CArcTan2Node; +class CMatVecMultiplicationNode; +class CMinNode; +class CMaxNode; +class CFmodNode; +class CModNode; +class CPowNode; +class CSelectNode; +class CClampNode; +class CComposeVectorNode; +class CVectorFromScalarNode; +class CDecomposeVectorNode; +class CComposeMatrixNode; +class CMatrixFromRowsNode; +class CMatrixFromColumnsNode; +class CConstantNode; +class CConstVecNode; +class CConstMatNode; +class CMeshNode; +class CUnsignedMeshNode; +class CBeamLatticeNode; +class CFunctionGradientNode; +class CNormalizeDistanceNode; +class CFunctionCallNode; +class CNodeIterator; +class CFunction; +class CImplicitFunction; +class CFunctionFromImage3D; class CBuildItem; class CBuildItemIterator; class CSlice; @@ -119,11 +197,22 @@ typedef CColorGroupIterator CLib3MFColorGroupIterator; typedef CTexture2DGroupIterator CLib3MFTexture2DGroupIterator; typedef CCompositeMaterialsIterator CLib3MFCompositeMaterialsIterator; typedef CMultiPropertyGroupIterator CLib3MFMultiPropertyGroupIterator; +typedef CImage3DIterator CLib3MFImage3DIterator; +typedef CFunctionIterator CLib3MFFunctionIterator; +typedef CLevelSetIterator CLib3MFLevelSetIterator; typedef CMetaData CLib3MFMetaData; typedef CMetaDataGroup CLib3MFMetaDataGroup; +typedef CTriangleSet CLib3MFTriangleSet; typedef CObject CLib3MFObject; typedef CMeshObject CLib3MFMeshObject; +typedef CLevelSet CLib3MFLevelSet; typedef CBeamLattice CLib3MFBeamLattice; +typedef CFunctionReference CLib3MFFunctionReference; +typedef CVolumeDataColor CLib3MFVolumeDataColor; +typedef CMaterialMapping CLib3MFMaterialMapping; +typedef CVolumeDataComposite CLib3MFVolumeDataComposite; +typedef CVolumeDataProperty CLib3MFVolumeDataProperty; +typedef CVolumeData CLib3MFVolumeData; typedef CComponent CLib3MFComponent; typedef CComponentsObject CLib3MFComponentsObject; typedef CBeamSet CLib3MFBeamSet; @@ -132,8 +221,74 @@ typedef CColorGroup CLib3MFColorGroup; typedef CTexture2DGroup CLib3MFTexture2DGroup; typedef CCompositeMaterials CLib3MFCompositeMaterials; typedef CMultiPropertyGroup CLib3MFMultiPropertyGroup; +typedef CImage3D CLib3MFImage3D; +typedef CImageStack CLib3MFImageStack; typedef CAttachment CLib3MFAttachment; typedef CTexture2D CLib3MFTexture2D; +typedef CImplicitPort CLib3MFImplicitPort; +typedef CIterator CLib3MFIterator; +typedef CImplicitPortIterator CLib3MFImplicitPortIterator; +typedef CImplicitNode CLib3MFImplicitNode; +typedef COneInputNode CLib3MFOneInputNode; +typedef CSinNode CLib3MFSinNode; +typedef CCosNode CLib3MFCosNode; +typedef CTanNode CLib3MFTanNode; +typedef CArcSinNode CLib3MFArcSinNode; +typedef CArcCosNode CLib3MFArcCosNode; +typedef CArcTanNode CLib3MFArcTanNode; +typedef CSinhNode CLib3MFSinhNode; +typedef CCoshNode CLib3MFCoshNode; +typedef CTanhNode CLib3MFTanhNode; +typedef CRoundNode CLib3MFRoundNode; +typedef CCeilNode CLib3MFCeilNode; +typedef CFloorNode CLib3MFFloorNode; +typedef CSignNode CLib3MFSignNode; +typedef CFractNode CLib3MFFractNode; +typedef CAbsNode CLib3MFAbsNode; +typedef CExpNode CLib3MFExpNode; +typedef CLogNode CLib3MFLogNode; +typedef CLog2Node CLib3MFLog2Node; +typedef CLog10Node CLib3MFLog10Node; +typedef CLengthNode CLib3MFLengthNode; +typedef CTransposeNode CLib3MFTransposeNode; +typedef CInverseNode CLib3MFInverseNode; +typedef CSqrtNode CLib3MFSqrtNode; +typedef CResourceIdNode CLib3MFResourceIdNode; +typedef CTwoInputNode CLib3MFTwoInputNode; +typedef CAdditionNode CLib3MFAdditionNode; +typedef CSubtractionNode CLib3MFSubtractionNode; +typedef CMultiplicationNode CLib3MFMultiplicationNode; +typedef CDivisionNode CLib3MFDivisionNode; +typedef CDotNode CLib3MFDotNode; +typedef CCrossNode CLib3MFCrossNode; +typedef CArcTan2Node CLib3MFArcTan2Node; +typedef CMatVecMultiplicationNode CLib3MFMatVecMultiplicationNode; +typedef CMinNode CLib3MFMinNode; +typedef CMaxNode CLib3MFMaxNode; +typedef CFmodNode CLib3MFFmodNode; +typedef CModNode CLib3MFModNode; +typedef CPowNode CLib3MFPowNode; +typedef CSelectNode CLib3MFSelectNode; +typedef CClampNode CLib3MFClampNode; +typedef CComposeVectorNode CLib3MFComposeVectorNode; +typedef CVectorFromScalarNode CLib3MFVectorFromScalarNode; +typedef CDecomposeVectorNode CLib3MFDecomposeVectorNode; +typedef CComposeMatrixNode CLib3MFComposeMatrixNode; +typedef CMatrixFromRowsNode CLib3MFMatrixFromRowsNode; +typedef CMatrixFromColumnsNode CLib3MFMatrixFromColumnsNode; +typedef CConstantNode CLib3MFConstantNode; +typedef CConstVecNode CLib3MFConstVecNode; +typedef CConstMatNode CLib3MFConstMatNode; +typedef CMeshNode CLib3MFMeshNode; +typedef CUnsignedMeshNode CLib3MFUnsignedMeshNode; +typedef CBeamLatticeNode CLib3MFBeamLatticeNode; +typedef CFunctionGradientNode CLib3MFFunctionGradientNode; +typedef CNormalizeDistanceNode CLib3MFNormalizeDistanceNode; +typedef CFunctionCallNode CLib3MFFunctionCallNode; +typedef CNodeIterator CLib3MFNodeIterator; +typedef CFunction CLib3MFFunction; +typedef CImplicitFunction CLib3MFImplicitFunction; +typedef CFunctionFromImage3D CLib3MFFunctionFromImage3D; typedef CBuildItem CLib3MFBuildItem; typedef CBuildItemIterator CLib3MFBuildItemIterator; typedef CSlice CLib3MFSlice; @@ -166,11 +321,22 @@ typedef std::shared_ptr PColorGroupIterator; typedef std::shared_ptr PTexture2DGroupIterator; typedef std::shared_ptr PCompositeMaterialsIterator; typedef std::shared_ptr PMultiPropertyGroupIterator; +typedef std::shared_ptr PImage3DIterator; +typedef std::shared_ptr PFunctionIterator; +typedef std::shared_ptr PLevelSetIterator; typedef std::shared_ptr PMetaData; typedef std::shared_ptr PMetaDataGroup; +typedef std::shared_ptr PTriangleSet; typedef std::shared_ptr PObject; typedef std::shared_ptr PMeshObject; +typedef std::shared_ptr PLevelSet; typedef std::shared_ptr PBeamLattice; +typedef std::shared_ptr PFunctionReference; +typedef std::shared_ptr PVolumeDataColor; +typedef std::shared_ptr PMaterialMapping; +typedef std::shared_ptr PVolumeDataComposite; +typedef std::shared_ptr PVolumeDataProperty; +typedef std::shared_ptr PVolumeData; typedef std::shared_ptr PComponent; typedef std::shared_ptr PComponentsObject; typedef std::shared_ptr PBeamSet; @@ -179,8 +345,74 @@ typedef std::shared_ptr PColorGroup; typedef std::shared_ptr PTexture2DGroup; typedef std::shared_ptr PCompositeMaterials; typedef std::shared_ptr PMultiPropertyGroup; +typedef std::shared_ptr PImage3D; +typedef std::shared_ptr PImageStack; typedef std::shared_ptr PAttachment; typedef std::shared_ptr PTexture2D; +typedef std::shared_ptr PImplicitPort; +typedef std::shared_ptr PIterator; +typedef std::shared_ptr PImplicitPortIterator; +typedef std::shared_ptr PImplicitNode; +typedef std::shared_ptr POneInputNode; +typedef std::shared_ptr PSinNode; +typedef std::shared_ptr PCosNode; +typedef std::shared_ptr PTanNode; +typedef std::shared_ptr PArcSinNode; +typedef std::shared_ptr PArcCosNode; +typedef std::shared_ptr PArcTanNode; +typedef std::shared_ptr PSinhNode; +typedef std::shared_ptr PCoshNode; +typedef std::shared_ptr PTanhNode; +typedef std::shared_ptr PRoundNode; +typedef std::shared_ptr PCeilNode; +typedef std::shared_ptr PFloorNode; +typedef std::shared_ptr PSignNode; +typedef std::shared_ptr PFractNode; +typedef std::shared_ptr PAbsNode; +typedef std::shared_ptr PExpNode; +typedef std::shared_ptr PLogNode; +typedef std::shared_ptr PLog2Node; +typedef std::shared_ptr PLog10Node; +typedef std::shared_ptr PLengthNode; +typedef std::shared_ptr PTransposeNode; +typedef std::shared_ptr PInverseNode; +typedef std::shared_ptr PSqrtNode; +typedef std::shared_ptr PResourceIdNode; +typedef std::shared_ptr PTwoInputNode; +typedef std::shared_ptr PAdditionNode; +typedef std::shared_ptr PSubtractionNode; +typedef std::shared_ptr PMultiplicationNode; +typedef std::shared_ptr PDivisionNode; +typedef std::shared_ptr PDotNode; +typedef std::shared_ptr PCrossNode; +typedef std::shared_ptr PArcTan2Node; +typedef std::shared_ptr PMatVecMultiplicationNode; +typedef std::shared_ptr PMinNode; +typedef std::shared_ptr PMaxNode; +typedef std::shared_ptr PFmodNode; +typedef std::shared_ptr PModNode; +typedef std::shared_ptr PPowNode; +typedef std::shared_ptr PSelectNode; +typedef std::shared_ptr PClampNode; +typedef std::shared_ptr PComposeVectorNode; +typedef std::shared_ptr PVectorFromScalarNode; +typedef std::shared_ptr PDecomposeVectorNode; +typedef std::shared_ptr PComposeMatrixNode; +typedef std::shared_ptr PMatrixFromRowsNode; +typedef std::shared_ptr PMatrixFromColumnsNode; +typedef std::shared_ptr PConstantNode; +typedef std::shared_ptr PConstVecNode; +typedef std::shared_ptr PConstMatNode; +typedef std::shared_ptr PMeshNode; +typedef std::shared_ptr PUnsignedMeshNode; +typedef std::shared_ptr PBeamLatticeNode; +typedef std::shared_ptr PFunctionGradientNode; +typedef std::shared_ptr PNormalizeDistanceNode; +typedef std::shared_ptr PFunctionCallNode; +typedef std::shared_ptr PNodeIterator; +typedef std::shared_ptr PFunction; +typedef std::shared_ptr PImplicitFunction; +typedef std::shared_ptr PFunctionFromImage3D; typedef std::shared_ptr PBuildItem; typedef std::shared_ptr PBuildItemIterator; typedef std::shared_ptr PSlice; @@ -213,11 +445,22 @@ typedef PColorGroupIterator PLib3MFColorGroupIterator; typedef PTexture2DGroupIterator PLib3MFTexture2DGroupIterator; typedef PCompositeMaterialsIterator PLib3MFCompositeMaterialsIterator; typedef PMultiPropertyGroupIterator PLib3MFMultiPropertyGroupIterator; +typedef PImage3DIterator PLib3MFImage3DIterator; +typedef PFunctionIterator PLib3MFFunctionIterator; +typedef PLevelSetIterator PLib3MFLevelSetIterator; typedef PMetaData PLib3MFMetaData; typedef PMetaDataGroup PLib3MFMetaDataGroup; +typedef PTriangleSet PLib3MFTriangleSet; typedef PObject PLib3MFObject; typedef PMeshObject PLib3MFMeshObject; +typedef PLevelSet PLib3MFLevelSet; typedef PBeamLattice PLib3MFBeamLattice; +typedef PFunctionReference PLib3MFFunctionReference; +typedef PVolumeDataColor PLib3MFVolumeDataColor; +typedef PMaterialMapping PLib3MFMaterialMapping; +typedef PVolumeDataComposite PLib3MFVolumeDataComposite; +typedef PVolumeDataProperty PLib3MFVolumeDataProperty; +typedef PVolumeData PLib3MFVolumeData; typedef PComponent PLib3MFComponent; typedef PComponentsObject PLib3MFComponentsObject; typedef PBeamSet PLib3MFBeamSet; @@ -226,8 +469,74 @@ typedef PColorGroup PLib3MFColorGroup; typedef PTexture2DGroup PLib3MFTexture2DGroup; typedef PCompositeMaterials PLib3MFCompositeMaterials; typedef PMultiPropertyGroup PLib3MFMultiPropertyGroup; +typedef PImage3D PLib3MFImage3D; +typedef PImageStack PLib3MFImageStack; typedef PAttachment PLib3MFAttachment; typedef PTexture2D PLib3MFTexture2D; +typedef PImplicitPort PLib3MFImplicitPort; +typedef PIterator PLib3MFIterator; +typedef PImplicitPortIterator PLib3MFImplicitPortIterator; +typedef PImplicitNode PLib3MFImplicitNode; +typedef POneInputNode PLib3MFOneInputNode; +typedef PSinNode PLib3MFSinNode; +typedef PCosNode PLib3MFCosNode; +typedef PTanNode PLib3MFTanNode; +typedef PArcSinNode PLib3MFArcSinNode; +typedef PArcCosNode PLib3MFArcCosNode; +typedef PArcTanNode PLib3MFArcTanNode; +typedef PSinhNode PLib3MFSinhNode; +typedef PCoshNode PLib3MFCoshNode; +typedef PTanhNode PLib3MFTanhNode; +typedef PRoundNode PLib3MFRoundNode; +typedef PCeilNode PLib3MFCeilNode; +typedef PFloorNode PLib3MFFloorNode; +typedef PSignNode PLib3MFSignNode; +typedef PFractNode PLib3MFFractNode; +typedef PAbsNode PLib3MFAbsNode; +typedef PExpNode PLib3MFExpNode; +typedef PLogNode PLib3MFLogNode; +typedef PLog2Node PLib3MFLog2Node; +typedef PLog10Node PLib3MFLog10Node; +typedef PLengthNode PLib3MFLengthNode; +typedef PTransposeNode PLib3MFTransposeNode; +typedef PInverseNode PLib3MFInverseNode; +typedef PSqrtNode PLib3MFSqrtNode; +typedef PResourceIdNode PLib3MFResourceIdNode; +typedef PTwoInputNode PLib3MFTwoInputNode; +typedef PAdditionNode PLib3MFAdditionNode; +typedef PSubtractionNode PLib3MFSubtractionNode; +typedef PMultiplicationNode PLib3MFMultiplicationNode; +typedef PDivisionNode PLib3MFDivisionNode; +typedef PDotNode PLib3MFDotNode; +typedef PCrossNode PLib3MFCrossNode; +typedef PArcTan2Node PLib3MFArcTan2Node; +typedef PMatVecMultiplicationNode PLib3MFMatVecMultiplicationNode; +typedef PMinNode PLib3MFMinNode; +typedef PMaxNode PLib3MFMaxNode; +typedef PFmodNode PLib3MFFmodNode; +typedef PModNode PLib3MFModNode; +typedef PPowNode PLib3MFPowNode; +typedef PSelectNode PLib3MFSelectNode; +typedef PClampNode PLib3MFClampNode; +typedef PComposeVectorNode PLib3MFComposeVectorNode; +typedef PVectorFromScalarNode PLib3MFVectorFromScalarNode; +typedef PDecomposeVectorNode PLib3MFDecomposeVectorNode; +typedef PComposeMatrixNode PLib3MFComposeMatrixNode; +typedef PMatrixFromRowsNode PLib3MFMatrixFromRowsNode; +typedef PMatrixFromColumnsNode PLib3MFMatrixFromColumnsNode; +typedef PConstantNode PLib3MFConstantNode; +typedef PConstVecNode PLib3MFConstVecNode; +typedef PConstMatNode PLib3MFConstMatNode; +typedef PMeshNode PLib3MFMeshNode; +typedef PUnsignedMeshNode PLib3MFUnsignedMeshNode; +typedef PBeamLatticeNode PLib3MFBeamLatticeNode; +typedef PFunctionGradientNode PLib3MFFunctionGradientNode; +typedef PNormalizeDistanceNode PLib3MFNormalizeDistanceNode; +typedef PFunctionCallNode PLib3MFFunctionCallNode; +typedef PNodeIterator PLib3MFNodeIterator; +typedef PFunction PLib3MFFunction; +typedef PImplicitFunction PLib3MFImplicitFunction; +typedef PFunctionFromImage3D PLib3MFFunctionFromImage3D; typedef PBuildItem PLib3MFBuildItem; typedef PBuildItemIterator PLib3MFBuildItemIterator; typedef PSlice PLib3MFSlice; @@ -241,6 +550,35 @@ typedef PKeyStore PLib3MFKeyStore; typedef PModel PLib3MFModel; +/************************************************************************************************************************* + classParam Definition +**************************************************************************************************************************/ + +template class classParam { +private: + std::shared_ptr m_sharedPtr; + const T* m_ptr; + +public: + classParam(const T* ptr) + : m_ptr(ptr) + { + } + + classParam(std::shared_ptr sharedPtr) + : m_sharedPtr(sharedPtr), m_ptr(sharedPtr.get()) + { + } + + Lib3MFHandle GetHandle() + { + if (m_ptr != nullptr) + return m_ptr->handle(); + return (Lib3MFHandle)nullptr; + } +}; + + /************************************************************************************************************************* Class ELib3MFException **************************************************************************************************************************/ @@ -254,21 +592,22 @@ protected: * Error message for the Exception. */ std::string m_errorMessage; + std::string m_originalErrorMessage; public: /** * Exception Constructor. */ ELib3MFException(Lib3MFResult errorCode, const std::string & sErrorMessage) - : m_errorMessage("Lib3MF Error " + std::to_string(errorCode) + " (" + sErrorMessage + ")") + : m_errorCode(errorCode), m_originalErrorMessage(sErrorMessage) { - m_errorCode = errorCode; + m_errorMessage = buildErrorMessage(); } /** * Returns error code */ - Lib3MFResult getErrorCode() const + Lib3MFResult getErrorCode() const noexcept { return m_errorCode; } @@ -276,11 +615,142 @@ public: /** * Returns error message */ - const char* what() const + const char* what() const noexcept { return m_errorMessage.c_str(); } + const char* getErrorMessage() const noexcept + { + return m_originalErrorMessage.c_str(); + } + + const char* getErrorName() const noexcept + { + switch(getErrorCode()) { + case LIB3MF_SUCCESS: return "SUCCESS"; + case LIB3MF_ERROR_NOTIMPLEMENTED: return "NOTIMPLEMENTED"; + case LIB3MF_ERROR_INVALIDPARAM: return "INVALIDPARAM"; + case LIB3MF_ERROR_INVALIDCAST: return "INVALIDCAST"; + case LIB3MF_ERROR_BUFFERTOOSMALL: return "BUFFERTOOSMALL"; + case LIB3MF_ERROR_GENERICEXCEPTION: return "GENERICEXCEPTION"; + case LIB3MF_ERROR_COULDNOTLOADLIBRARY: return "COULDNOTLOADLIBRARY"; + case LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT: return "COULDNOTFINDLIBRARYEXPORT"; + case LIB3MF_ERROR_INCOMPATIBLEBINARYVERSION: return "INCOMPATIBLEBINARYVERSION"; + case LIB3MF_ERROR_CALCULATIONABORTED: return "CALCULATIONABORTED"; + case LIB3MF_ERROR_SHOULDNOTBECALLED: return "SHOULDNOTBECALLED"; + case LIB3MF_ERROR_READERCLASSUNKNOWN: return "READERCLASSUNKNOWN"; + case LIB3MF_ERROR_WRITERCLASSUNKNOWN: return "WRITERCLASSUNKNOWN"; + case LIB3MF_ERROR_ITERATORINVALIDINDEX: return "ITERATORINVALIDINDEX"; + case LIB3MF_ERROR_INVALIDMODELRESOURCE: return "INVALIDMODELRESOURCE"; + case LIB3MF_ERROR_RESOURCENOTFOUND: return "RESOURCENOTFOUND"; + case LIB3MF_ERROR_INVALIDMODEL: return "INVALIDMODEL"; + case LIB3MF_ERROR_INVALIDOBJECT: return "INVALIDOBJECT"; + case LIB3MF_ERROR_INVALIDMESHOBJECT: return "INVALIDMESHOBJECT"; + case LIB3MF_ERROR_INVALIDCOMPONENTSOBJECT: return "INVALIDCOMPONENTSOBJECT"; + case LIB3MF_ERROR_INVALIDCOMPONENT: return "INVALIDCOMPONENT"; + case LIB3MF_ERROR_INVALIDBUILDITEM: return "INVALIDBUILDITEM"; + case LIB3MF_ERROR_INVALIDBASEMATERIALGROUP: return "INVALIDBASEMATERIALGROUP"; + case LIB3MF_ERROR_INVALIDSLICESTACKRESOURCE: return "INVALIDSLICESTACKRESOURCE"; + case LIB3MF_ERROR_INVALIDTEXTURERESOURCE: return "INVALIDTEXTURERESOURCE"; + case LIB3MF_ERROR_INVALIDCOLORGROUP: return "INVALIDCOLORGROUP"; + case LIB3MF_ERROR_INVALIDTEXTURE2DGROUP: return "INVALIDTEXTURE2DGROUP"; + case LIB3MF_ERROR_INVALIDCOMPOSITEMATERIALS: return "INVALIDCOMPOSITEMATERIALS"; + case LIB3MF_ERROR_INVALIDMULTIPROPERTYGROUP: return "INVALIDMULTIPROPERTYGROUP"; + case LIB3MF_ERROR_INVALIDRESOURCEINDEX: return "INVALIDRESOURCEINDEX"; + case LIB3MF_ERROR_ATTACHMENTNOTFOUND: return "ATTACHMENTNOTFOUND"; + case LIB3MF_ERROR_FORBIDDENCYCLICREFERENCE: return "FORBIDDENCYCLICREFERENCE"; + case LIB3MF_ERROR_INVALIDATTACHMENTSTREAM: return "INVALIDATTACHMENTSTREAM"; + case LIB3MF_ERROR_INVALIDPROPERTYCOUNT: return "INVALIDPROPERTYCOUNT"; + case LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER: return "UNKOWNPROGRESSIDENTIFIER"; + case LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT: return "ELEMENTCOUNTEXCEEDSLIMIT"; + case LIB3MF_ERROR_INVALIDRESOURCE: return "INVALIDRESOURCE"; + case LIB3MF_ERROR_INVALIDLEVELSET: return "INVALIDLEVELSET"; + case LIB3MF_ERROR_COULDNOTFINDTRIANGLESET: return "COULDNOTFINDTRIANGLESET"; + case LIB3MF_ERROR_INVALIDTRIANGLESETINDEX: return "INVALIDTRIANGLESETINDEX"; + case LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE: return "BEAMLATTICE_INVALID_OBJECTTYPE"; + case LIB3MF_ERROR_INVALIDKEYSTORE: return "INVALIDKEYSTORE"; + case LIB3MF_ERROR_INVALIDKEYSTORECONSUMER: return "INVALIDKEYSTORECONSUMER"; + case LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND: return "KEYSTORECONSUMERNOTFOUND"; + case LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND: return "KEYSTORERESOURCEDATANOTFOUND"; + case LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED: return "SECURECONTEXTNOTREGISTERED"; + case LIB3MF_ERROR_INVALIDKEYSIZE: return "INVALIDKEYSIZE"; + case LIB3MF_ERROR_INCOMPATIBLEPORTTYPES: return "INCOMPATIBLEPORTTYPES"; + case LIB3MF_ERROR_GRAPHISCYCLIC: return "GRAPHISCYCLIC"; + case LIB3MF_ERROR_INPUTNOTSET: return "INPUTNOTSET"; + case LIB3MF_ERROR_INVALIDNODECONFIGURATION: return "INVALIDNODECONFIGURATION"; + } + return "UNKNOWN"; + } + + const char* getErrorDescription() const noexcept + { + switch(getErrorCode()) { + case LIB3MF_SUCCESS: return "success"; + 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_INVALIDLEVELSET: return "A level set is invalid"; + case LIB3MF_ERROR_COULDNOTFINDTRIANGLESET: return "Could not find triangle set"; + case LIB3MF_ERROR_INVALIDTRIANGLESETINDEX: return "Invalid triangle set index"; + 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_INCOMPATIBLEPORTTYPES: return "Link could not be added, the port types are incompatible"; + case LIB3MF_ERROR_GRAPHISCYCLIC: return "The functin graph is cyclic. Only dircected graphs are valid and can be topological sorted."; + case LIB3MF_ERROR_INPUTNOTSET: return "The input of a node is not set."; + case LIB3MF_ERROR_INVALIDNODECONFIGURATION: return "The selected node configuration is not supported"; + } + return "unknown error"; + } + +private: + + std::string buildErrorMessage() const noexcept + { + std::string msg = m_originalErrorMessage; + if (msg.empty()) { + msg = getErrorDescription(); + } + return std::string("Error: ") + getErrorName() + ": " + msg; + } }; /************************************************************************************************************************* @@ -346,10 +816,10 @@ public: inline bool GetBuildInformation(std::string & sBuildInformation); inline void GetSpecificationVersion(const std::string & sSpecificationURL, bool & bIsSupported, Lib3MF_uint32 & nMajor, Lib3MF_uint32 & nMinor, Lib3MF_uint32 & nMicro); inline PModel CreateModel(); - inline void Release(CBase * pInstance); - inline void Acquire(CBase * pInstance); + inline void Release(classParam pInstance); + inline void Acquire(classParam pInstance); inline void SetJournal(const std::string & sJournalPath); - inline bool GetLastError(CBase * pInstance, std::string & sLastErrorString); + inline bool GetLastError(classParam pInstance, std::string & sLastErrorString); inline Lib3MF_pvoid GetSymbolLookupMethod(); inline void RetrieveProgressMessage(const eProgressIdentifier eTheProgressIdentifier, std::string & sProgressMessage); inline sColor RGBAToColor(const Lib3MF_uint8 nRed, const Lib3MF_uint8 nGreen, const Lib3MF_uint8 nBlue, const Lib3MF_uint8 nAlpha); @@ -361,6 +831,8 @@ public: inline sTransform GetScaleTransform(const Lib3MF_single fFactorX, const Lib3MF_single fFactorY, const Lib3MF_single fFactorZ); inline sTransform GetTranslationTransform(const Lib3MF_single fVectorX, const Lib3MF_single fVectorY, const Lib3MF_single fVectorZ); + inline CBase* polymorphicFactory(Lib3MFHandle); + private: Lib3MFResult checkBinaryVersion() @@ -389,11 +861,22 @@ private: friend class CTexture2DGroupIterator; friend class CCompositeMaterialsIterator; friend class CMultiPropertyGroupIterator; + friend class CImage3DIterator; + friend class CFunctionIterator; + friend class CLevelSetIterator; friend class CMetaData; friend class CMetaDataGroup; + friend class CTriangleSet; friend class CObject; friend class CMeshObject; + friend class CLevelSet; friend class CBeamLattice; + friend class CFunctionReference; + friend class CVolumeDataColor; + friend class CMaterialMapping; + friend class CVolumeDataComposite; + friend class CVolumeDataProperty; + friend class CVolumeData; friend class CComponent; friend class CComponentsObject; friend class CBeamSet; @@ -402,8 +885,74 @@ private: friend class CTexture2DGroup; friend class CCompositeMaterials; friend class CMultiPropertyGroup; + friend class CImage3D; + friend class CImageStack; friend class CAttachment; friend class CTexture2D; + friend class CImplicitPort; + friend class CIterator; + friend class CImplicitPortIterator; + friend class CImplicitNode; + friend class COneInputNode; + friend class CSinNode; + friend class CCosNode; + friend class CTanNode; + friend class CArcSinNode; + friend class CArcCosNode; + friend class CArcTanNode; + friend class CSinhNode; + friend class CCoshNode; + friend class CTanhNode; + friend class CRoundNode; + friend class CCeilNode; + friend class CFloorNode; + friend class CSignNode; + friend class CFractNode; + friend class CAbsNode; + friend class CExpNode; + friend class CLogNode; + friend class CLog2Node; + friend class CLog10Node; + friend class CLengthNode; + friend class CTransposeNode; + friend class CInverseNode; + friend class CSqrtNode; + friend class CResourceIdNode; + friend class CTwoInputNode; + friend class CAdditionNode; + friend class CSubtractionNode; + friend class CMultiplicationNode; + friend class CDivisionNode; + friend class CDotNode; + friend class CCrossNode; + friend class CArcTan2Node; + friend class CMatVecMultiplicationNode; + friend class CMinNode; + friend class CMaxNode; + friend class CFmodNode; + friend class CModNode; + friend class CPowNode; + friend class CSelectNode; + friend class CClampNode; + friend class CComposeVectorNode; + friend class CVectorFromScalarNode; + friend class CDecomposeVectorNode; + friend class CComposeMatrixNode; + friend class CMatrixFromRowsNode; + friend class CMatrixFromColumnsNode; + friend class CConstantNode; + friend class CConstVecNode; + friend class CConstMatNode; + friend class CMeshNode; + friend class CUnsignedMeshNode; + friend class CBeamLatticeNode; + friend class CFunctionGradientNode; + friend class CNormalizeDistanceNode; + friend class CFunctionCallNode; + friend class CNodeIterator; + friend class CFunction; + friend class CImplicitFunction; + friend class CFunctionFromImage3D; friend class CBuildItem; friend class CBuildItemIterator; friend class CSlice; @@ -457,14 +1006,25 @@ public: } /** - * CBase::GetHandle - Returns handle to instance. + * CBase::handle - Returns handle to instance. */ - Lib3MFHandle GetHandle() + Lib3MFHandle handle() const { return m_pHandle; } - + + /** + * CBase::wrapper - Returns wrapper instance. + */ + CWrapper * wrapper() const + { + return m_pWrapper; + } + friend class CWrapper; + inline Lib3MF_uint64 ClassTypeId(); + +protected: }; /************************************************************************************************************************* @@ -559,7 +1119,7 @@ public: inline Lib3MF_uint32 GetResourceID(); inline Lib3MF_uint32 GetUniqueResourceID(); inline PPackagePart PackagePart(); - inline void SetPackagePart(CPackagePart * pPackagePart); + inline void SetPackagePart(classParam pPackagePart); inline Lib3MF_uint32 GetModelResourceID(); }; @@ -754,6 +1314,57 @@ public: inline PMultiPropertyGroup GetCurrentMultiPropertyGroup(); }; +/************************************************************************************************************************* + Class CImage3DIterator +**************************************************************************************************************************/ +class CImage3DIterator : public CResourceIterator { +public: + + /** + * CImage3DIterator::CImage3DIterator - Constructor for Image3DIterator class. + */ + CImage3DIterator(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CResourceIterator(pWrapper, pHandle) + { + } + + inline PImage3D GetCurrentImage3D(); +}; + +/************************************************************************************************************************* + Class CFunctionIterator +**************************************************************************************************************************/ +class CFunctionIterator : public CResourceIterator { +public: + + /** + * CFunctionIterator::CFunctionIterator - Constructor for FunctionIterator class. + */ + CFunctionIterator(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CResourceIterator(pWrapper, pHandle) + { + } + + inline PFunction GetCurrentFunction(); +}; + +/************************************************************************************************************************* + Class CLevelSetIterator +**************************************************************************************************************************/ +class CLevelSetIterator : public CResourceIterator { +public: + + /** + * CLevelSetIterator::CLevelSetIterator - Constructor for LevelSetIterator class. + */ + CLevelSetIterator(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CResourceIterator(pWrapper, pHandle) + { + } + + inline PLevelSet GetCurrentLevelSet(); +}; + /************************************************************************************************************************* Class CMetaData **************************************************************************************************************************/ @@ -799,10 +1410,39 @@ public: inline PMetaData GetMetaData(const Lib3MF_uint32 nIndex); inline PMetaData GetMetaDataByKey(const std::string & sNameSpace, const std::string & sName); inline void RemoveMetaDataByIndex(const Lib3MF_uint32 nIndex); - inline void RemoveMetaData(CMetaData * pTheMetaData); + inline void RemoveMetaData(classParam pTheMetaData); inline PMetaData AddMetaData(const std::string & sNameSpace, const std::string & sName, const std::string & sValue, const std::string & sType, const bool bMustPreserve); }; +/************************************************************************************************************************* + Class CTriangleSet +**************************************************************************************************************************/ +class CTriangleSet : public CBase { +public: + + /** + * CTriangleSet::CTriangleSet - Constructor for TriangleSet class. + */ + CTriangleSet(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline void SetName(const std::string & sName); + inline std::string GetName(); + inline void SetIdentifier(const std::string & sIdentifier); + inline std::string GetIdentifier(); + inline void AddTriangle(const Lib3MF_uint32 nTriangleIndex); + inline void RemoveTriangle(const Lib3MF_uint32 nTriangleIndex); + inline void Clear(); + inline void SetTriangleList(const CInputVector & TriangleIndicesBuffer); + inline void GetTriangleList(std::vector & TriangleIndicesBuffer); + inline void AddTriangleList(const CInputVector & TriangleIndicesBuffer); + inline void Merge(classParam pOtherTriangleSet, const bool bDeleteOther); + inline void DeleteSet(); + inline PTriangleSet Duplicate(const std::string & sIdentifier); +}; + /************************************************************************************************************************* Class CObject **************************************************************************************************************************/ @@ -825,8 +1465,9 @@ public: inline void SetPartNumber(const std::string & sPartNumber); inline bool IsMeshObject(); inline bool IsComponentsObject(); + inline bool IsLevelSetObject(); inline bool IsValid(); - inline void SetAttachmentAsThumbnail(CAttachment * pAttachment); + inline void SetAttachmentAsThumbnail(classParam pAttachment); inline PAttachment GetThumbnailAttachment(); inline void ClearThumbnailAttachment(); inline sBox GetOutbox(); @@ -838,7 +1479,7 @@ public: inline bool HasSlices(const bool bRecursive); inline void ClearSliceStack(); inline PSliceStack GetSliceStack(); - inline void AssignSliceStack(CSliceStack * pSliceStackInstance); + inline void AssignSliceStack(classParam pSliceStackInstance); }; /************************************************************************************************************************* @@ -875,6 +1516,45 @@ public: inline void SetGeometry(const CInputVector & VerticesBuffer, const CInputVector & IndicesBuffer); inline bool IsManifoldAndOriented(); inline PBeamLattice BeamLattice(); + inline PVolumeData GetVolumeData(); + inline void SetVolumeData(classParam pTheVolumeData); + inline PTriangleSet AddTriangleSet(const std::string & sIdentifier, const std::string & sName); + inline bool HasTriangleSet(const std::string & sIdentifier); + inline PTriangleSet FindTriangleSet(const std::string & sIdentifier); + inline Lib3MF_uint32 GetTriangleSetCount(); + inline PTriangleSet GetTriangleSet(const Lib3MF_uint32 nIndex); +}; + +/************************************************************************************************************************* + Class CLevelSet +**************************************************************************************************************************/ +class CLevelSet : public CObject { +public: + + /** + * CLevelSet::CLevelSet - Constructor for LevelSet class. + */ + CLevelSet(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CObject(pWrapper, pHandle) + { + } + + inline PFunction GetFunction(); + inline void SetFunction(classParam pTheFunction); + inline sTransform GetTransform(); + inline void SetTransform(const sTransform & Transform); + inline std::string GetChannelName(); + inline void SetChannelName(const std::string & sChannelName); + inline void SetMinFeatureSize(const Lib3MF_double dMinFeatureSize); + inline Lib3MF_double GetMinFeatureSize(); + inline void SetFallBackValue(const Lib3MF_double dFallBackValue); + inline Lib3MF_double GetFallBackValue(); + inline void SetMeshBBoxOnly(const bool bMeshBBoxOnly); + inline bool GetMeshBBoxOnly(); + inline void SetMesh(classParam pTheMesh); + inline PMeshObject GetMesh(); + inline PVolumeData GetVolumeData(); + inline void SetVolumeData(classParam pTheVolumeData); }; /************************************************************************************************************************* @@ -916,6 +1596,131 @@ public: inline PBeamSet GetBeamSet(const Lib3MF_uint32 nIndex); }; +/************************************************************************************************************************* + Class CFunctionReference +**************************************************************************************************************************/ +class CFunctionReference : public CBase { +public: + + /** + * CFunctionReference::CFunctionReference - Constructor for FunctionReference class. + */ + CFunctionReference(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline Lib3MF_uint32 GetFunctionResourceID(); + inline void SetFunctionResourceID(const Lib3MF_uint32 nUniqueResourceID); + inline sTransform GetTransform(); + inline void SetTransform(const sTransform & Transform); + inline std::string GetChannelName(); + inline void SetChannelName(const std::string & sChannelName); + inline void SetMinFeatureSize(const Lib3MF_double dMinFeatureSize); + inline Lib3MF_double GetMinFeatureSize(); + inline void SetFallBackValue(const Lib3MF_double dFallBackValue); + inline Lib3MF_double GetFallBackValue(); +}; + +/************************************************************************************************************************* + Class CVolumeDataColor +**************************************************************************************************************************/ +class CVolumeDataColor : public CFunctionReference { +public: + + /** + * CVolumeDataColor::CVolumeDataColor - Constructor for VolumeDataColor class. + */ + CVolumeDataColor(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CFunctionReference(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CMaterialMapping +**************************************************************************************************************************/ +class CMaterialMapping : public CFunctionReference { +public: + + /** + * CMaterialMapping::CMaterialMapping - Constructor for MaterialMapping class. + */ + CMaterialMapping(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CFunctionReference(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CVolumeDataComposite +**************************************************************************************************************************/ +class CVolumeDataComposite : public CBase { +public: + + /** + * CVolumeDataComposite::CVolumeDataComposite - Constructor for VolumeDataComposite class. + */ + CVolumeDataComposite(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline PBaseMaterialGroup GetBaseMaterialGroup(); + inline void SetBaseMaterialGroup(classParam pBaseMaterialGroupInstance); + inline Lib3MF_uint32 GetMaterialMappingCount(); + inline PMaterialMapping GetMaterialMapping(const Lib3MF_uint32 nIndex); + inline PMaterialMapping AddMaterialMapping(const sTransform & Transform); + inline void RemoveMaterialMapping(const Lib3MF_uint32 nIndex); +}; + +/************************************************************************************************************************* + Class CVolumeDataProperty +**************************************************************************************************************************/ +class CVolumeDataProperty : public CFunctionReference { +public: + + /** + * CVolumeDataProperty::CVolumeDataProperty - Constructor for VolumeDataProperty class. + */ + CVolumeDataProperty(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CFunctionReference(pWrapper, pHandle) + { + } + + inline std::string GetName(); + inline void SetIsRequired(const bool bIsRequired); + inline bool IsRequired(); +}; + +/************************************************************************************************************************* + Class CVolumeData +**************************************************************************************************************************/ +class CVolumeData : public CResource { +public: + + /** + * CVolumeData::CVolumeData - Constructor for VolumeData class. + */ + CVolumeData(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CResource(pWrapper, pHandle) + { + } + + inline PVolumeDataComposite GetComposite(); + inline PVolumeDataComposite CreateNewComposite(); + inline void RemoveComposite(); + inline PVolumeDataColor GetColor(); + inline PVolumeDataColor CreateNewColor(classParam pTheFunction); + inline void RemoveColor(); + inline Lib3MF_uint32 GetPropertyCount(); + inline PVolumeDataProperty GetProperty(const Lib3MF_uint32 nIndex); + inline PVolumeDataProperty AddPropertyFromFunction(const std::string & sName, classParam pTheFunction); + inline void RemoveProperty(const Lib3MF_uint32 nIndex); +}; + /************************************************************************************************************************* Class CComponent **************************************************************************************************************************/ @@ -953,7 +1758,7 @@ public: { } - inline PComponent AddComponent(CObject * pObjectResource, const sTransform & Transform); + inline PComponent AddComponent(classParam pObjectResource, const sTransform & Transform); inline PComponent GetComponent(const Lib3MF_uint32 nIndex); inline Lib3MF_uint32 GetComponentCount(); }; @@ -1100,6 +1905,51 @@ public: inline void RemoveLayer(const Lib3MF_uint32 nLayerIndex); }; +/************************************************************************************************************************* + Class CImage3D +**************************************************************************************************************************/ +class CImage3D : public CResource { +public: + + /** + * CImage3D::CImage3D - Constructor for Image3D class. + */ + CImage3D(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CResource(pWrapper, pHandle) + { + } + + inline std::string GetName(); + inline void SetName(const std::string & sName); + inline bool IsImageStack(); +}; + +/************************************************************************************************************************* + Class CImageStack +**************************************************************************************************************************/ +class CImageStack : public CImage3D { +public: + + /** + * CImageStack::CImageStack - Constructor for ImageStack class. + */ + CImageStack(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImage3D(pWrapper, pHandle) + { + } + + inline Lib3MF_uint32 GetRowCount(); + inline void SetRowCount(const Lib3MF_uint32 nRowCount); + inline Lib3MF_uint32 GetColumnCount(); + inline void SetColumnCount(const Lib3MF_uint32 nColumnCount); + inline Lib3MF_uint32 GetSheetCount(); + inline PAttachment GetSheet(const Lib3MF_uint32 nIndex); + inline void SetSheet(const Lib3MF_uint32 nIndex, classParam pSheet); + inline PAttachment CreateEmptySheet(const Lib3MF_uint32 nIndex, const std::string & sPath); + inline PAttachment CreateSheetFromBuffer(const Lib3MF_uint32 nIndex, const std::string & sPath, const CInputVector & DataBuffer); + inline PAttachment CreateSheetFromFile(const Lib3MF_uint32 nIndex, const std::string & sPath, const std::string & sFileName); +}; + /************************************************************************************************************************* Class CAttachment **************************************************************************************************************************/ @@ -1142,7 +1992,7 @@ public: } inline PAttachment GetAttachment(); - inline void SetAttachment(CAttachment * pAttachment); + inline void SetAttachment(classParam pAttachment); inline eTextureType GetContentType(); inline void SetContentType(const eTextureType eContentType); inline void GetTileStyleUV(eTextureTileStyle & eTileStyleU, eTextureTileStyle & eTileStyleV); @@ -1151,6 +2001,1223 @@ public: inline void SetFilter(const eTextureFilter eFilter); }; +/************************************************************************************************************************* + Class CImplicitPort +**************************************************************************************************************************/ +class CImplicitPort : public CBase { +public: + + /** + * CImplicitPort::CImplicitPort - Constructor for ImplicitPort class. + */ + CImplicitPort(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline std::string GetIdentifier(); + inline void SetIdentifier(const std::string & sIdentifier); + inline std::string GetDisplayName(); + inline void SetDisplayName(const std::string & sDisplayName); + inline void SetType(const eImplicitPortType eImplicitPortType); + inline eImplicitPortType GetType(); + inline std::string GetReference(); + inline void SetReference(const std::string & sReference); +}; + +/************************************************************************************************************************* + Class CIterator +**************************************************************************************************************************/ +class CIterator : public CBase { +public: + + /** + * CIterator::CIterator - Constructor for Iterator class. + */ + CIterator(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline bool MoveNext(); + inline bool MovePrevious(); + inline Lib3MF_uint64 Count(); +}; + +/************************************************************************************************************************* + Class CImplicitPortIterator +**************************************************************************************************************************/ +class CImplicitPortIterator : public CIterator { +public: + + /** + * CImplicitPortIterator::CImplicitPortIterator - Constructor for ImplicitPortIterator class. + */ + CImplicitPortIterator(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CIterator(pWrapper, pHandle) + { + } + + inline PImplicitPort GetCurrent(); +}; + +/************************************************************************************************************************* + Class CImplicitNode +**************************************************************************************************************************/ +class CImplicitNode : public CBase { +public: + + /** + * CImplicitNode::CImplicitNode - Constructor for ImplicitNode class. + */ + CImplicitNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline std::string GetIdentifier(); + inline void SetIdentifier(const std::string & sIdentifier); + inline std::string GetDisplayName(); + inline void SetDisplayName(const std::string & sDisplayName); + inline std::string GetTag(); + inline void SetTag(const std::string & sTag); + inline eImplicitNodeType GetNodeType(); + inline PImplicitPort AddInput(const std::string & sIdentifier, const std::string & sDisplayName); + inline PImplicitPortIterator GetInputs(); + inline PImplicitPort AddOutput(const std::string & sIdentifier, const std::string & sDisplayName); + inline PImplicitPortIterator GetOutputs(); + inline PImplicitPort FindInput(const std::string & sIdentifier); + inline PImplicitPort FindOutput(const std::string & sIdentifier); + inline bool AreTypesValid(); +}; + +/************************************************************************************************************************* + Class COneInputNode +**************************************************************************************************************************/ +class COneInputNode : public CImplicitNode { +public: + + /** + * COneInputNode::COneInputNode - Constructor for OneInputNode class. + */ + COneInputNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputA(); + inline PImplicitPort GetOutputResult(); +}; + +/************************************************************************************************************************* + Class CSinNode +**************************************************************************************************************************/ +class CSinNode : public COneInputNode { +public: + + /** + * CSinNode::CSinNode - Constructor for SinNode class. + */ + CSinNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CCosNode +**************************************************************************************************************************/ +class CCosNode : public COneInputNode { +public: + + /** + * CCosNode::CCosNode - Constructor for CosNode class. + */ + CCosNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CTanNode +**************************************************************************************************************************/ +class CTanNode : public COneInputNode { +public: + + /** + * CTanNode::CTanNode - Constructor for TanNode class. + */ + CTanNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CArcSinNode +**************************************************************************************************************************/ +class CArcSinNode : public COneInputNode { +public: + + /** + * CArcSinNode::CArcSinNode - Constructor for ArcSinNode class. + */ + CArcSinNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CArcCosNode +**************************************************************************************************************************/ +class CArcCosNode : public COneInputNode { +public: + + /** + * CArcCosNode::CArcCosNode - Constructor for ArcCosNode class. + */ + CArcCosNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CArcTanNode +**************************************************************************************************************************/ +class CArcTanNode : public COneInputNode { +public: + + /** + * CArcTanNode::CArcTanNode - Constructor for ArcTanNode class. + */ + CArcTanNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CSinhNode +**************************************************************************************************************************/ +class CSinhNode : public COneInputNode { +public: + + /** + * CSinhNode::CSinhNode - Constructor for SinhNode class. + */ + CSinhNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CCoshNode +**************************************************************************************************************************/ +class CCoshNode : public COneInputNode { +public: + + /** + * CCoshNode::CCoshNode - Constructor for CoshNode class. + */ + CCoshNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CTanhNode +**************************************************************************************************************************/ +class CTanhNode : public COneInputNode { +public: + + /** + * CTanhNode::CTanhNode - Constructor for TanhNode class. + */ + CTanhNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CRoundNode +**************************************************************************************************************************/ +class CRoundNode : public COneInputNode { +public: + + /** + * CRoundNode::CRoundNode - Constructor for RoundNode class. + */ + CRoundNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CCeilNode +**************************************************************************************************************************/ +class CCeilNode : public COneInputNode { +public: + + /** + * CCeilNode::CCeilNode - Constructor for CeilNode class. + */ + CCeilNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CFloorNode +**************************************************************************************************************************/ +class CFloorNode : public COneInputNode { +public: + + /** + * CFloorNode::CFloorNode - Constructor for FloorNode class. + */ + CFloorNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CSignNode +**************************************************************************************************************************/ +class CSignNode : public COneInputNode { +public: + + /** + * CSignNode::CSignNode - Constructor for SignNode class. + */ + CSignNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CFractNode +**************************************************************************************************************************/ +class CFractNode : public COneInputNode { +public: + + /** + * CFractNode::CFractNode - Constructor for FractNode class. + */ + CFractNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CAbsNode +**************************************************************************************************************************/ +class CAbsNode : public COneInputNode { +public: + + /** + * CAbsNode::CAbsNode - Constructor for AbsNode class. + */ + CAbsNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CExpNode +**************************************************************************************************************************/ +class CExpNode : public COneInputNode { +public: + + /** + * CExpNode::CExpNode - Constructor for ExpNode class. + */ + CExpNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CLogNode +**************************************************************************************************************************/ +class CLogNode : public COneInputNode { +public: + + /** + * CLogNode::CLogNode - Constructor for LogNode class. + */ + CLogNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CLog2Node +**************************************************************************************************************************/ +class CLog2Node : public COneInputNode { +public: + + /** + * CLog2Node::CLog2Node - Constructor for Log2Node class. + */ + CLog2Node(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CLog10Node +**************************************************************************************************************************/ +class CLog10Node : public COneInputNode { +public: + + /** + * CLog10Node::CLog10Node - Constructor for Log10Node class. + */ + CLog10Node(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CLengthNode +**************************************************************************************************************************/ +class CLengthNode : public COneInputNode { +public: + + /** + * CLengthNode::CLengthNode - Constructor for LengthNode class. + */ + CLengthNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CTransposeNode +**************************************************************************************************************************/ +class CTransposeNode : public COneInputNode { +public: + + /** + * CTransposeNode::CTransposeNode - Constructor for TransposeNode class. + */ + CTransposeNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CInverseNode +**************************************************************************************************************************/ +class CInverseNode : public COneInputNode { +public: + + /** + * CInverseNode::CInverseNode - Constructor for InverseNode class. + */ + CInverseNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CSqrtNode +**************************************************************************************************************************/ +class CSqrtNode : public COneInputNode { +public: + + /** + * CSqrtNode::CSqrtNode - Constructor for SqrtNode class. + */ + CSqrtNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CResourceIdNode +**************************************************************************************************************************/ +class CResourceIdNode : public CImplicitNode { +public: + + /** + * CResourceIdNode::CResourceIdNode - Constructor for ResourceIdNode class. + */ + CResourceIdNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline void SetResource(classParam pResource); + inline PResource GetResource(); + inline PImplicitPort GetOutputValue(); +}; + +/************************************************************************************************************************* + Class CTwoInputNode +**************************************************************************************************************************/ +class CTwoInputNode : public COneInputNode { +public: + + /** + * CTwoInputNode::CTwoInputNode - Constructor for TwoInputNode class. + */ + CTwoInputNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputB(); +}; + +/************************************************************************************************************************* + Class CAdditionNode +**************************************************************************************************************************/ +class CAdditionNode : public CTwoInputNode { +public: + + /** + * CAdditionNode::CAdditionNode - Constructor for AdditionNode class. + */ + CAdditionNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CTwoInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CSubtractionNode +**************************************************************************************************************************/ +class CSubtractionNode : public CTwoInputNode { +public: + + /** + * CSubtractionNode::CSubtractionNode - Constructor for SubtractionNode class. + */ + CSubtractionNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CTwoInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CMultiplicationNode +**************************************************************************************************************************/ +class CMultiplicationNode : public CTwoInputNode { +public: + + /** + * CMultiplicationNode::CMultiplicationNode - Constructor for MultiplicationNode class. + */ + CMultiplicationNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CTwoInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CDivisionNode +**************************************************************************************************************************/ +class CDivisionNode : public CTwoInputNode { +public: + + /** + * CDivisionNode::CDivisionNode - Constructor for DivisionNode class. + */ + CDivisionNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CTwoInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CDotNode +**************************************************************************************************************************/ +class CDotNode : public CTwoInputNode { +public: + + /** + * CDotNode::CDotNode - Constructor for DotNode class. + */ + CDotNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CTwoInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CCrossNode +**************************************************************************************************************************/ +class CCrossNode : public CTwoInputNode { +public: + + /** + * CCrossNode::CCrossNode - Constructor for CrossNode class. + */ + CCrossNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CTwoInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CArcTan2Node +**************************************************************************************************************************/ +class CArcTan2Node : public CTwoInputNode { +public: + + /** + * CArcTan2Node::CArcTan2Node - Constructor for ArcTan2Node class. + */ + CArcTan2Node(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CTwoInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CMatVecMultiplicationNode +**************************************************************************************************************************/ +class CMatVecMultiplicationNode : public CTwoInputNode { +public: + + /** + * CMatVecMultiplicationNode::CMatVecMultiplicationNode - Constructor for MatVecMultiplicationNode class. + */ + CMatVecMultiplicationNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CTwoInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CMinNode +**************************************************************************************************************************/ +class CMinNode : public CTwoInputNode { +public: + + /** + * CMinNode::CMinNode - Constructor for MinNode class. + */ + CMinNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CTwoInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CMaxNode +**************************************************************************************************************************/ +class CMaxNode : public CTwoInputNode { +public: + + /** + * CMaxNode::CMaxNode - Constructor for MaxNode class. + */ + CMaxNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CTwoInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CFmodNode +**************************************************************************************************************************/ +class CFmodNode : public CTwoInputNode { +public: + + /** + * CFmodNode::CFmodNode - Constructor for FmodNode class. + */ + CFmodNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CTwoInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CModNode +**************************************************************************************************************************/ +class CModNode : public CTwoInputNode { +public: + + /** + * CModNode::CModNode - Constructor for ModNode class. + */ + CModNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CTwoInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CPowNode +**************************************************************************************************************************/ +class CPowNode : public CTwoInputNode { +public: + + /** + * CPowNode::CPowNode - Constructor for PowNode class. + */ + CPowNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CTwoInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CSelectNode +**************************************************************************************************************************/ +class CSelectNode : public COneInputNode { +public: + + /** + * CSelectNode::CSelectNode - Constructor for SelectNode class. + */ + CSelectNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputB(); + inline PImplicitPort GetInputC(); + inline PImplicitPort GetInputD(); +}; + +/************************************************************************************************************************* + Class CClampNode +**************************************************************************************************************************/ +class CClampNode : public COneInputNode { +public: + + /** + * CClampNode::CClampNode - Constructor for ClampNode class. + */ + CClampNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputMin(); + inline PImplicitPort GetInputMax(); +}; + +/************************************************************************************************************************* + Class CComposeVectorNode +**************************************************************************************************************************/ +class CComposeVectorNode : public CImplicitNode { +public: + + /** + * CComposeVectorNode::CComposeVectorNode - Constructor for ComposeVectorNode class. + */ + CComposeVectorNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputX(); + inline PImplicitPort GetInputY(); + inline PImplicitPort GetInputZ(); + inline PImplicitPort GetOutputResult(); +}; + +/************************************************************************************************************************* + Class CVectorFromScalarNode +**************************************************************************************************************************/ +class CVectorFromScalarNode : public COneInputNode { +public: + + /** + * CVectorFromScalarNode::CVectorFromScalarNode - Constructor for VectorFromScalarNode class. + */ + CVectorFromScalarNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : COneInputNode(pWrapper, pHandle) + { + } + +}; + +/************************************************************************************************************************* + Class CDecomposeVectorNode +**************************************************************************************************************************/ +class CDecomposeVectorNode : public CImplicitNode { +public: + + /** + * CDecomposeVectorNode::CDecomposeVectorNode - Constructor for DecomposeVectorNode class. + */ + CDecomposeVectorNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputA(); + inline PImplicitPort GetOutputX(); + inline PImplicitPort GetOutputY(); + inline PImplicitPort GetOutputZ(); +}; + +/************************************************************************************************************************* + Class CComposeMatrixNode +**************************************************************************************************************************/ +class CComposeMatrixNode : public CImplicitNode { +public: + + /** + * CComposeMatrixNode::CComposeMatrixNode - Constructor for ComposeMatrixNode class. + */ + CComposeMatrixNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputM00(); + inline PImplicitPort GetInputM01(); + inline PImplicitPort GetInputM02(); + inline PImplicitPort GetInputM03(); + inline PImplicitPort GetInputM10(); + inline PImplicitPort GetInputM11(); + inline PImplicitPort GetInputM12(); + inline PImplicitPort GetInputM13(); + inline PImplicitPort GetInputM20(); + inline PImplicitPort GetInputM21(); + inline PImplicitPort GetInputM22(); + inline PImplicitPort GetInputM23(); + inline PImplicitPort GetInputM30(); + inline PImplicitPort GetInputM31(); + inline PImplicitPort GetInputM32(); + inline PImplicitPort GetInputM33(); + inline PImplicitPort GetOutputResult(); +}; + +/************************************************************************************************************************* + Class CMatrixFromRowsNode +**************************************************************************************************************************/ +class CMatrixFromRowsNode : public CImplicitNode { +public: + + /** + * CMatrixFromRowsNode::CMatrixFromRowsNode - Constructor for MatrixFromRowsNode class. + */ + CMatrixFromRowsNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputA(); + inline PImplicitPort GetInputB(); + inline PImplicitPort GetInputC(); + inline PImplicitPort GetInputD(); + inline PImplicitPort GetOutputResult(); +}; + +/************************************************************************************************************************* + Class CMatrixFromColumnsNode +**************************************************************************************************************************/ +class CMatrixFromColumnsNode : public CImplicitNode { +public: + + /** + * CMatrixFromColumnsNode::CMatrixFromColumnsNode - Constructor for MatrixFromColumnsNode class. + */ + CMatrixFromColumnsNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputA(); + inline PImplicitPort GetInputB(); + inline PImplicitPort GetInputC(); + inline PImplicitPort GetInputD(); + inline PImplicitPort GetOutputResult(); +}; + +/************************************************************************************************************************* + Class CConstantNode +**************************************************************************************************************************/ +class CConstantNode : public CImplicitNode { +public: + + /** + * CConstantNode::CConstantNode - Constructor for ConstantNode class. + */ + CConstantNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline void SetConstant(const Lib3MF_double dValue); + inline Lib3MF_double GetConstant(); + inline PImplicitPort GetOutputValue(); +}; + +/************************************************************************************************************************* + Class CConstVecNode +**************************************************************************************************************************/ +class CConstVecNode : public CImplicitNode { +public: + + /** + * CConstVecNode::CConstVecNode - Constructor for ConstVecNode class. + */ + CConstVecNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline void SetVector(const sVector & Value); + inline sVector GetVector(); + inline PImplicitPort GetOutputVector(); +}; + +/************************************************************************************************************************* + Class CConstMatNode +**************************************************************************************************************************/ +class CConstMatNode : public CImplicitNode { +public: + + /** + * CConstMatNode::CConstMatNode - Constructor for ConstMatNode class. + */ + CConstMatNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline void SetMatrix(const sMatrix4x4 & Value); + inline sMatrix4x4 GetMatrix(); + inline PImplicitPort GetOutputMatrix(); +}; + +/************************************************************************************************************************* + Class CMeshNode +**************************************************************************************************************************/ +class CMeshNode : public CImplicitNode { +public: + + /** + * CMeshNode::CMeshNode - Constructor for MeshNode class. + */ + CMeshNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputMesh(); + inline PImplicitPort GetInputPos(); + inline PImplicitPort GetOutputDistance(); +}; + +/************************************************************************************************************************* + Class CUnsignedMeshNode +**************************************************************************************************************************/ +class CUnsignedMeshNode : public CImplicitNode { +public: + + /** + * CUnsignedMeshNode::CUnsignedMeshNode - Constructor for UnsignedMeshNode class. + */ + CUnsignedMeshNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputMesh(); + inline PImplicitPort GetInputPos(); + inline PImplicitPort GetOutputDistance(); +}; + +/************************************************************************************************************************* + Class CBeamLatticeNode +**************************************************************************************************************************/ +class CBeamLatticeNode : public CImplicitNode { +public: + + /** + * CBeamLatticeNode::CBeamLatticeNode - Constructor for BeamLatticeNode class. + */ + CBeamLatticeNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputBeamLattice(); + inline PImplicitPort GetInputPos(); + inline PImplicitPort GetOutputDistance(); + inline void SetAccurateRange(const Lib3MF_double dAccurateRange); + inline Lib3MF_double GetAccurateRange(); +}; + +/************************************************************************************************************************* + Class CFunctionGradientNode +**************************************************************************************************************************/ +class CFunctionGradientNode : public CImplicitNode { +public: + + /** + * CFunctionGradientNode::CFunctionGradientNode - Constructor for FunctionGradientNode class. + */ + CFunctionGradientNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputFunctionID(); + inline PImplicitPort GetInputPos(); + inline PImplicitPort GetInputStep(); + inline void SetScalarOutputName(const std::string & sScalarOutputName); + inline std::string GetScalarOutputName(); + inline void SetVectorInputName(const std::string & sVectorInputName); + inline std::string GetVectorInputName(); + inline PImplicitPort GetOutputNormalizedGradient(); + inline PImplicitPort GetOutputGradient(); + inline PImplicitPort GetOutputMagnitude(); +}; + +/************************************************************************************************************************* + Class CNormalizeDistanceNode +**************************************************************************************************************************/ +class CNormalizeDistanceNode : public CImplicitNode { +public: + + /** + * CNormalizeDistanceNode::CNormalizeDistanceNode - Constructor for NormalizeDistanceNode class. + */ + CNormalizeDistanceNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputFunctionID(); + inline PImplicitPort GetInputPos(); + inline PImplicitPort GetInputStep(); + inline void SetScalarOutputName(const std::string & sScalarOutputName); + inline std::string GetScalarOutputName(); + inline void SetVectorInputName(const std::string & sVectorInputName); + inline std::string GetVectorInputName(); + inline PImplicitPort GetOutputResult(); +}; + +/************************************************************************************************************************* + Class CFunctionCallNode +**************************************************************************************************************************/ +class CFunctionCallNode : public CImplicitNode { +public: + + /** + * CFunctionCallNode::CFunctionCallNode - Constructor for FunctionCallNode class. + */ + CFunctionCallNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputFunctionID(); +}; + +/************************************************************************************************************************* + Class CNodeIterator +**************************************************************************************************************************/ +class CNodeIterator : public CIterator { +public: + + /** + * CNodeIterator::CNodeIterator - Constructor for NodeIterator class. + */ + CNodeIterator(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CIterator(pWrapper, pHandle) + { + } + + inline PImplicitNode GetCurrent(); +}; + +/************************************************************************************************************************* + Class CFunction +**************************************************************************************************************************/ +class CFunction : public CResource { +public: + + /** + * CFunction::CFunction - Constructor for Function class. + */ + CFunction(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CResource(pWrapper, pHandle) + { + } + + inline std::string GetDisplayName(); + inline void SetDisplayName(const std::string & sDisplayName); + inline PImplicitPort AddInput(const std::string & sIdentifier, const std::string & sDisplayName, const eImplicitPortType eType); + inline PImplicitPortIterator GetInputs(); + inline void RemoveInput(classParam pInput); + inline PImplicitPort AddOutput(const std::string & sIdentifier, const std::string & sDisplayName, const eImplicitPortType eType); + inline PImplicitPortIterator GetOutputs(); + inline void RemoveOutput(classParam pOutput); + inline PImplicitPort FindInput(const std::string & sIdentifier); + inline PImplicitPort FindOutput(const std::string & sIdentifier); +}; + +/************************************************************************************************************************* + Class CImplicitFunction +**************************************************************************************************************************/ +class CImplicitFunction : public CFunction { +public: + + /** + * CImplicitFunction::CImplicitFunction - Constructor for ImplicitFunction class. + */ + CImplicitFunction(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CFunction(pWrapper, pHandle) + { + } + + inline std::string GetIdentifier(); + inline void SetIdentifier(const std::string & sIdentifier); + inline PImplicitNode AddNode(const eImplicitNodeType eNodeType, const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PSinNode AddSinNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PCosNode AddCosNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PTanNode AddTanNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PArcSinNode AddArcSinNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PArcCosNode AddArcCosNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PArcTan2Node AddArcTan2Node(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PSinhNode AddSinhNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PCoshNode AddCoshNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PTanhNode AddTanhNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PRoundNode AddRoundNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PCeilNode AddCeilNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PFloorNode AddFloorNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PSignNode AddSignNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PFractNode AddFractNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PAbsNode AddAbsNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PExpNode AddExpNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PLogNode AddLogNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PLog2Node AddLog2Node(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PLog10Node AddLog10Node(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PLengthNode AddLengthNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PTransposeNode AddTransposeNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PInverseNode AddInverseNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PSqrtNode AddSqrtNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PResourceIdNode AddResourceIdNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PAdditionNode AddAdditionNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PSubtractionNode AddSubtractionNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PMultiplicationNode AddMultiplicationNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PDivisionNode AddDivisionNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PDotNode AddDotNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PCrossNode AddCrossNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PMatVecMultiplicationNode AddMatVecMultiplicationNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PMinNode AddMinNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PMaxNode AddMaxNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PFmodNode AddFmodNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PPowNode AddPowNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PSelectNode AddSelectNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PClampNode AddClampNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag); + inline PComposeVectorNode AddComposeVectorNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PVectorFromScalarNode AddVectorFromScalarNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PDecomposeVectorNode AddDecomposeVectorNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PComposeMatrixNode AddComposeMatrixNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PMatrixFromRowsNode AddMatrixFromRowsNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PMatrixFromColumnsNode AddMatrixFromColumnsNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PConstantNode AddConstantNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PConstVecNode AddConstVecNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PConstMatNode AddConstMatNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PMeshNode AddMeshNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PUnsignedMeshNode AddUnsignedMeshNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PBeamLatticeNode AddBeamLatticeNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PFunctionGradientNode AddFunctionGradientNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PNormalizeDistanceNode AddNormalizeDistanceNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PFunctionCallNode AddFunctionCallNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PNodeIterator GetNodes(); + inline void RemoveNode(classParam pNode); + inline void AddLink(classParam pSource, classParam pTarget); + inline void AddLinkByNames(const std::string & sSource, const std::string & sTarget); + inline void Clear(); + inline void SortNodesTopologically(); +}; + +/************************************************************************************************************************* + Class CFunctionFromImage3D +**************************************************************************************************************************/ +class CFunctionFromImage3D : public CFunction { +public: + + /** + * CFunctionFromImage3D::CFunctionFromImage3D - Constructor for FunctionFromImage3D class. + */ + CFunctionFromImage3D(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CFunction(pWrapper, pHandle) + { + } + + inline PImage3D GetImage3D(); + inline void SetImage3D(classParam pImage3D); + inline void SetFilter(const eTextureFilter eFilter); + inline eTextureFilter GetFilter(); + inline void SetTileStyles(const eTextureTileStyle eTileStyleU, const eTextureTileStyle eTileStyleV, const eTextureTileStyle eTileStyleW); + inline void GetTileStyles(eTextureTileStyle & eTileStyleU, eTextureTileStyle & eTileStyleV, eTextureTileStyle & eTileStyleW); + inline Lib3MF_double GetOffset(); + inline void SetOffset(const Lib3MF_double dOffset); + inline Lib3MF_double GetScale(); + inline void SetScale(const Lib3MF_double dScale); +}; + /************************************************************************************************************************* Class CBuildItem **************************************************************************************************************************/ @@ -1243,7 +3310,7 @@ public: inline PSlice GetSlice(const Lib3MF_uint64 nSliceIndex); inline PSlice AddSlice(const Lib3MF_double dZTop); inline Lib3MF_uint64 GetSliceRefCount(); - inline void AddSliceStackReference(CSliceStack * pTheSliceStack); + inline void AddSliceStackReference(classParam pTheSliceStack); inline PSliceStack GetSliceStackReference(const Lib3MF_uint64 nSliceRefIndex); inline void CollapseSliceReferences(); inline void SetOwnPath(const std::string & sPath); @@ -1348,9 +3415,9 @@ public: } inline std::string GetKeyUUID(); - inline PAccessRight AddAccessRight(CConsumer * pConsumer, const eWrappingAlgorithm eWrappingAlgorithm, const eMgfAlgorithm eMgfAlgorithm, const eDigestMethod eDigestMethod); - inline PAccessRight FindAccessRightByConsumer(CConsumer * pConsumer); - inline void RemoveAccessRight(CConsumer * pConsumer); + inline PAccessRight AddAccessRight(classParam pConsumer, const eWrappingAlgorithm eWrappingAlgorithm, const eMgfAlgorithm eMgfAlgorithm, const eDigestMethod eDigestMethod); + inline PAccessRight FindAccessRightByConsumer(classParam pConsumer); + inline void RemoveAccessRight(classParam pConsumer); }; /************************************************************************************************************************* @@ -1370,16 +3437,16 @@ public: inline PConsumer AddConsumer(const std::string & sConsumerID, const std::string & sKeyID, const std::string & sKeyValue); inline Lib3MF_uint64 GetConsumerCount(); inline PConsumer GetConsumer(const Lib3MF_uint64 nConsumerIndex); - inline void RemoveConsumer(CConsumer * pConsumer); + inline void RemoveConsumer(classParam pConsumer); inline PConsumer FindConsumer(const std::string & sConsumerID); inline Lib3MF_uint64 GetResourceDataGroupCount(); inline PResourceDataGroup AddResourceDataGroup(); inline PResourceDataGroup GetResourceDataGroup(const Lib3MF_uint64 nResourceDataIndex); - inline void RemoveResourceDataGroup(CResourceDataGroup * pResourceDataGroup); - inline PResourceDataGroup FindResourceDataGroup(CPackagePart * pPartPath); - inline PResourceData AddResourceData(CResourceDataGroup * pResourceDataGroup, CPackagePart * pPartPath, const eEncryptionAlgorithm eAlgorithm, const eCompression eCompression, const CInputVector & AdditionalAuthenticationDataBuffer); - inline void RemoveResourceData(CResourceData * pResourceData); - inline PResourceData FindResourceData(CPackagePart * pResourcePath); + inline void RemoveResourceDataGroup(classParam pResourceDataGroup); + inline PResourceDataGroup FindResourceDataGroup(classParam pPartPath); + inline PResourceData AddResourceData(classParam pResourceDataGroup, classParam pPartPath, const eEncryptionAlgorithm eAlgorithm, const eCompression eCompression, const CInputVector & AdditionalAuthenticationDataBuffer); + inline void RemoveResourceData(classParam pResourceData); + inline PResourceData FindResourceData(classParam pResourcePath); inline Lib3MF_uint64 GetResourceDataCount(); inline PResourceData GetResourceData(const Lib3MF_uint64 nResourceDataIndex); inline std::string GetUUID(bool & bHasUUID); @@ -1408,6 +3475,7 @@ public: inline void SetLanguage(const std::string & sLanguage); inline PWriter QueryWriter(const std::string & sWriterClass); inline PReader QueryReader(const std::string & sReaderClass); + inline PResource GetResourceByID(const Lib3MF_uint32 nUniqueResourceID); inline PTexture2D GetTexture2DByID(const Lib3MF_uint32 nUniqueResourceID); inline ePropertyType GetPropertyTypeByID(const Lib3MF_uint32 nUniqueResourceID); inline PBaseMaterialGroup GetBaseMaterialGroupByID(const Lib3MF_uint32 nUniqueResourceID); @@ -1418,6 +3486,7 @@ public: inline PComponentsObject GetComponentsObjectByID(const Lib3MF_uint32 nUniqueResourceID); inline PColorGroup GetColorGroupByID(const Lib3MF_uint32 nUniqueResourceID); inline PSliceStack GetSliceStackByID(const Lib3MF_uint32 nUniqueResourceID); + inline PLevelSet GetLevelSetByID(const Lib3MF_uint32 nUniqueResourceID); inline std::string GetBuildUUID(bool & bHasUUID); inline void SetBuildUUID(const std::string & sUUID); inline PBuildItemIterator GetBuildItems(); @@ -1433,21 +3502,25 @@ public: inline PCompositeMaterialsIterator GetCompositeMaterials(); inline PMultiPropertyGroupIterator GetMultiPropertyGroups(); inline PSliceStackIterator GetSliceStacks(); + inline PImage3DIterator GetImage3Ds(); inline PModel MergeToModel(); + inline void MergeFromModel(classParam pModelInstance); inline PMeshObject AddMeshObject(); inline PComponentsObject AddComponentsObject(); inline PSliceStack AddSliceStack(const Lib3MF_double dZBottom); - inline PTexture2D AddTexture2DFromAttachment(CAttachment * pTextureAttachment); + inline PTexture2D AddTexture2DFromAttachment(classParam pTextureAttachment); inline PBaseMaterialGroup AddBaseMaterialGroup(); inline PColorGroup AddColorGroup(); - inline PTexture2DGroup AddTexture2DGroup(CTexture2D * pTexture2DInstance); - inline PCompositeMaterials AddCompositeMaterials(CBaseMaterialGroup * pBaseMaterialGroupInstance); + inline PTexture2DGroup AddTexture2DGroup(classParam pTexture2DInstance); + inline PCompositeMaterials AddCompositeMaterials(classParam pBaseMaterialGroupInstance); inline PMultiPropertyGroup AddMultiPropertyGroup(); - inline PBuildItem AddBuildItem(CObject * pObject, const sTransform & Transform); - inline void RemoveBuildItem(CBuildItem * pBuildItemInstance); + inline PImageStack AddImageStack(const Lib3MF_uint32 nColumnCount, const Lib3MF_uint32 nRowCount, const Lib3MF_uint32 nSheetCount); + inline PImageStack GetImageStackByID(const Lib3MF_uint32 nUniqueResourceID); + inline PBuildItem AddBuildItem(classParam pObject, const sTransform & Transform); + inline void RemoveBuildItem(classParam pBuildItemInstance); inline PMetaDataGroup GetMetaDataGroup(); inline PAttachment AddAttachment(const std::string & sURI, const std::string & sRelationShipType); - inline void RemoveAttachment(CAttachment * pAttachmentInstance); + inline void RemoveAttachment(classParam pAttachmentInstance); inline PAttachment GetAttachment(const Lib3MF_uint32 nIndex); inline PAttachment FindAttachment(const std::string & sURI); inline Lib3MF_uint32 GetAttachmentCount(); @@ -1459,7 +3532,153 @@ public: inline void RemoveCustomContentType(const std::string & sExtension); inline void SetRandomNumberCallback(const RandomNumberCallback pTheCallback, const Lib3MF_pvoid pUserData); inline PKeyStore GetKeyStore(); + inline PFunctionIterator GetFunctions(); + inline PImplicitFunction AddImplicitFunction(); + inline PFunctionFromImage3D AddFunctionFromImage3D(classParam pImage3DInstance); + inline PVolumeData AddVolumeData(); + inline PLevelSet AddLevelSet(); + inline PLevelSetIterator GetLevelSets(); + inline void RemoveResource(classParam pResource); }; + +/************************************************************************************************************************* + RTTI: Polymorphic Factory 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 +* CWrapper::AcquireInstance(CBase object) must be called after instantiating new object. +* This is important to keep reference count matching between application and library sides. +*/ +inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) +{ + Lib3MF_uint64 resultClassTypeId = 0; + 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 0xE76F642F363FD7E9UL: return new CWriter(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Writer" + 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 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" + case 0x564DE4217ED7614AUL: return new CComponentsObjectIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObjectIterator" + case 0x4BD32B4870FFC03BUL: return new CTexture2DIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DIterator" + case 0x65E6EDD9362C79CBUL: return new CBaseMaterialGroupIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroupIterator" + case 0x10274A1757C729C0UL: return new CColorGroupIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ColorGroupIterator" + case 0x30D55F4DB88FE0CAUL: return new CTexture2DGroupIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DGroupIterator" + case 0xA99CC6C3F70FB6F9UL: return new CCompositeMaterialsIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::CompositeMaterialsIterator" + case 0xC2BDF5D8CBBDB1F0UL: return new CMultiPropertyGroupIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MultiPropertyGroupIterator" + case 0xC4B8EC00A82BF336UL: return new CImage3DIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Image3DIterator" + case 0x40E9035363ACE65EUL: return new CFunctionIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionIterator" + case 0xA0C005C035D5371DUL: return new CLevelSetIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::LevelSetIterator" + case 0xD17716D063DE2C22UL: return new CMetaData(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MetaData" + case 0x0C3B85369E9B25D3UL: return new CMetaDataGroup(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MetaDataGroup" + case 0x5950BB3EE8A82090UL: return new CTriangleSet(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::TriangleSet" + case 0x2DA2136F577A779CUL: return new CObject(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Object" + case 0x3B3A6DC6EC610497UL: return new CMeshObject(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObject" + case 0xE8A7D9C192EFD0E2UL: return new CLevelSet(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::LevelSet" + case 0x63B3B461B30B4BA5UL: return new CBeamLattice(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BeamLattice" + case 0x4DF17E76926221C2UL: return new CFunctionReference(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionReference" + case 0xD85B5B6143E787E3UL: return new CVolumeDataColor(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::VolumeDataColor" + case 0x241FE6B4817C3FE4UL: return new CMaterialMapping(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MaterialMapping" + case 0x46F1DAC40581B304UL: return new CVolumeDataComposite(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::VolumeDataComposite" + case 0xFC368AA44ACE42DAUL: return new CVolumeDataProperty(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::VolumeDataProperty" + case 0x9200586FB91587A7UL: return new CVolumeData(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::VolumeData" + case 0x4ECDB6A6F69F2BEBUL: return new CComponent(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Component" + case 0x6522CF04EB283FEDUL: return new CComponentsObject(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObject" + case 0x30CCDBE90E00B55BUL: return new CBeamSet(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BeamSet" + case 0xB27D4656E16609FAUL: return new CBaseMaterialGroup(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroup" + case 0xD085FB2E49CDB5B1UL: return new CColorGroup(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ColorGroup" + case 0xBC1208397E37055DUL: return new CTexture2DGroup(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DGroup" + case 0xCE16224D688B86F2UL: return new CCompositeMaterials(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::CompositeMaterials" + case 0xB989E02E43158FE6UL: return new CMultiPropertyGroup(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MultiPropertyGroup" + case 0xBD938FF2D2663D61UL: return new CImage3D(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Image3D" + case 0x13A2561F0CFB712AUL: return new CImageStack(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ImageStack" + case 0x8CE7A1191A63A35DUL: return new CAttachment(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Attachment" + case 0xE0441CF976B36319UL: return new CTexture2D(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2D" + case 0xD5C49B04AF1963CDUL: return new CImplicitPort(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ImplicitPort" + case 0x52F06268CD098EFEUL: return new CIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Iterator" + case 0xC62268F2D7C7012CUL: return new CImplicitPortIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ImplicitPortIterator" + case 0xE72592A7725AB29BUL: return new CImplicitNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ImplicitNode" + case 0xB19B9FDA94B0A5E7UL: return new COneInputNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::OneInputNode" + case 0xD5AEA50A56306722UL: return new CSinNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::SinNode" + case 0x59BC328F6FB5C5FFUL: return new CCosNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::CosNode" + case 0x2614CC572AF350B7UL: return new CTanNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::TanNode" + case 0xE554C8A7E72AAF4DUL: return new CArcSinNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ArcSinNode" + case 0x943AF6AE0EFD2B8AUL: return new CArcCosNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ArcCosNode" + case 0xE47D547615816BADUL: return new CArcTanNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ArcTanNode" + case 0x3C7756A456F2D089UL: return new CSinhNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::SinhNode" + case 0x4A993F91E1DE256DUL: return new CCoshNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::CoshNode" + case 0xCF077B19B0B78E9DUL: return new CTanhNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::TanhNode" + case 0xD9F5A53C657765AEUL: return new CRoundNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::RoundNode" + case 0x627E211653E11D93UL: return new CCeilNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::CeilNode" + case 0x392A0F4C041D249CUL: return new CFloorNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::FloorNode" + case 0x8A45165E6C9646D7UL: return new CSignNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::SignNode" + case 0x53E62FD67F4D9A65UL: return new CFractNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::FractNode" + case 0x6B641C7060040BE3UL: return new CAbsNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::AbsNode" + case 0x3390243A8E2410F3UL: return new CExpNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ExpNode" + case 0x0070021D73AA89FDUL: return new CLogNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::LogNode" + case 0xE8C0ABF7C5DC7068UL: return new CLog2Node(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Log2Node" + case 0x87740AD53454E0DFUL: return new CLog10Node(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Log10Node" + case 0xD85889E2739A74B1UL: return new CLengthNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::LengthNode" + case 0xA808B7599C158CE6UL: return new CTransposeNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::TransposeNode" + case 0xE8601F66A23A0540UL: return new CInverseNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::InverseNode" + case 0x9F831944A3DE31DAUL: return new CSqrtNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::SqrtNode" + case 0xCA86A77C71CD3FAEUL: return new CResourceIdNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceIdNode" + case 0x7DE3951BA4C1064CUL: return new CTwoInputNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::TwoInputNode" + case 0x57A2236998DF5248UL: return new CAdditionNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::AdditionNode" + case 0x6079B12FFF345D02UL: return new CSubtractionNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::SubtractionNode" + case 0xA3C27CF54C2AA76CUL: return new CMultiplicationNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MultiplicationNode" + case 0xB896B6413C08CF39UL: return new CDivisionNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::DivisionNode" + case 0xFE60932A66375FADUL: return new CDotNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::DotNode" + case 0x106182D38CA5CFE3UL: return new CCrossNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::CrossNode" + case 0xB6153EF5DE7E5E11UL: return new CArcTan2Node(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ArcTan2Node" + case 0x7570C43B9721D0C0UL: return new CMatVecMultiplicationNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MatVecMultiplicationNode" + case 0x846AFDE9A091E997UL: return new CMinNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MinNode" + case 0x073F910381BF250DUL: return new CMaxNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MaxNode" + case 0x1EF703D298223F2AUL: return new CFmodNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::FmodNode" + case 0xEA57335849379F22UL: return new CModNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ModNode" + case 0x7700AA17CA1AC0F8UL: return new CPowNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::PowNode" + case 0x1127ED71E05A9BD4UL: return new CSelectNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::SelectNode" + case 0x77AF68C971B1485FUL: return new CClampNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ClampNode" + case 0x49C24B8840C01F7EUL: return new CComposeVectorNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ComposeVectorNode" + case 0x2E417B93351375E2UL: return new CVectorFromScalarNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::VectorFromScalarNode" + case 0xCC4F8D561CCE35D4UL: return new CDecomposeVectorNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::DecomposeVectorNode" + case 0x9EF9EB54A53AA40DUL: return new CComposeMatrixNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ComposeMatrixNode" + case 0xD6DFD0A7EB64AC33UL: return new CMatrixFromRowsNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MatrixFromRowsNode" + case 0x0DCBEAFCF83F3AACUL: return new CMatrixFromColumnsNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MatrixFromColumnsNode" + case 0x3F8E5D082F966B1BUL: return new CConstantNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ConstantNode" + case 0x9C9363B3F708D556UL: return new CConstVecNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ConstVecNode" + case 0xF85C90EDCE6F90A4UL: return new CConstMatNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ConstMatNode" + case 0x53601FD432E3DEF4UL: return new CMeshNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshNode" + case 0x29985A628251A9CDUL: return new CUnsignedMeshNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::UnsignedMeshNode" + case 0x0F3A4EE98F7FEC0CUL: return new CBeamLatticeNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BeamLatticeNode" + case 0x0437E27AEF740121UL: return new CFunctionGradientNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionGradientNode" + case 0x817D2E566E73AA8FUL: return new CNormalizeDistanceNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::NormalizeDistanceNode" + case 0x0765C17C952F24E3UL: return new CFunctionCallNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionCallNode" + case 0xFC006BC888CAB4D0UL: return new CNodeIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::NodeIterator" + case 0x9EFB2757CA1A5231UL: return new CFunction(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Function" + case 0x6CE54469EEA83BC1UL: return new CImplicitFunction(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ImplicitFunction" + case 0x9BD7D3C2026B8CE8UL: return new CFunctionFromImage3D(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionFromImage3D" + 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 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" + case 0x7FB36B91D4CE4671UL: return new CContentEncryptionParams(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ContentEncryptionParams" + case 0x1A47A5E258E22EF9UL: return new CResourceData(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceData" + case 0xD59067227E428AA4UL: return new CResourceDataGroup(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceDataGroup" + case 0x1CC9E0CC082253C6UL: return new CKeyStore(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::KeyStore" + case 0x5A8164ECEDB03F09UL: return new CModel(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Model" + } + return new CBase(this, pHandle); +} /** * CWrapper::GetLibraryVersion - retrieves the binary version of this library. @@ -1527,25 +3746,22 @@ public: */ inline PModel CWrapper::CreateModel() { - Lib3MFHandle hModel = nullptr; + Lib3MFHandle hModel = (Lib3MFHandle)nullptr; CheckError(nullptr,lib3mf_createmodel(&hModel)); if (!hModel) { CheckError(nullptr,LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(this, hModel); + return std::shared_ptr(dynamic_cast(this->polymorphicFactory(hModel))); } /** * CWrapper::Release - releases shared ownership of an object instance * @param[in] pInstance - the object instance to release */ - inline void CWrapper::Release(CBase * pInstance) + inline void CWrapper::Release(classParam pInstance) { - Lib3MFHandle hInstance = nullptr; - if (pInstance != nullptr) { - hInstance = pInstance->GetHandle(); - }; + Lib3MFHandle hInstance = pInstance.GetHandle(); CheckError(nullptr,lib3mf_release(hInstance)); } @@ -1553,12 +3769,9 @@ public: * CWrapper::Acquire - acquires shared ownership of an object instance * @param[in] pInstance - the object instance to acquire */ - inline void CWrapper::Acquire(CBase * pInstance) + inline void CWrapper::Acquire(classParam pInstance) { - Lib3MFHandle hInstance = nullptr; - if (pInstance != nullptr) { - hInstance = pInstance->GetHandle(); - }; + Lib3MFHandle hInstance = pInstance.GetHandle(); CheckError(nullptr,lib3mf_acquire(hInstance)); } @@ -1577,12 +3790,9 @@ public: * @param[out] sLastErrorString - Last Error String * @return Returns if the instance has a last error. */ - inline bool CWrapper::GetLastError(CBase * pInstance, std::string & sLastErrorString) + inline bool CWrapper::GetLastError(classParam pInstance, std::string & sLastErrorString) { - Lib3MFHandle hInstance = nullptr; - if (pInstance != nullptr) { - hInstance = pInstance->GetHandle(); - }; + Lib3MFHandle hInstance = pInstance.GetHandle(); Lib3MF_uint32 bytesNeededLastErrorString = 0; Lib3MF_uint32 bytesWrittenLastErrorString = 0; bool resultHasLastError = 0; @@ -1733,7 +3943,7 @@ public: return resultTransform; } - + inline void CWrapper::CheckError(CBase * pBaseClass, Lib3MFResult nResult) { if (nResult != 0) { @@ -1751,6 +3961,18 @@ public: * 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(lib3mf_base_classtypeid(m_pHandle, &resultClassTypeId)); + + return resultClassTypeId; + } + /** * Method definitions for class CWriter */ @@ -1921,7 +4143,8 @@ public: */ void CReader::ReadFromBuffer(const CInputVector & BufferBuffer) { - CheckError(lib3mf_reader_readfrombuffer(m_pHandle, (Lib3MF_uint64)BufferBuffer.size(), BufferBuffer.data())); + Lib3MF_uint64 nBufferSize = BufferBuffer.size(); + CheckError(lib3mf_reader_readfrombuffer(m_pHandle, nBufferSize, BufferBuffer.data())); } /** @@ -2097,25 +4320,22 @@ public: */ PPackagePart CResource::PackagePart() { - Lib3MFHandle hPackagePart = nullptr; + Lib3MFHandle hPackagePart = (Lib3MFHandle)nullptr; CheckError(lib3mf_resource_packagepart(m_pHandle, &hPackagePart)); if (!hPackagePart) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hPackagePart); + 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(CPackagePart * pPackagePart) + void CResource::SetPackagePart(classParam pPackagePart) { - Lib3MFHandle hPackagePart = nullptr; - if (pPackagePart != nullptr) { - hPackagePart = pPackagePart->GetHandle(); - }; + Lib3MFHandle hPackagePart = pPackagePart.GetHandle(); CheckError(lib3mf_resource_setpackagepart(m_pHandle, hPackagePart)); } @@ -2165,13 +4385,13 @@ public: */ PResource CResourceIterator::GetCurrent() { - Lib3MFHandle hResource = nullptr; + Lib3MFHandle hResource = (Lib3MFHandle)nullptr; CheckError(lib3mf_resourceiterator_getcurrent(m_pHandle, &hResource)); if (!hResource) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResource); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } /** @@ -2180,13 +4400,13 @@ public: */ PResourceIterator CResourceIterator::Clone() { - Lib3MFHandle hOutResourceIterator = nullptr; + Lib3MFHandle hOutResourceIterator = (Lib3MFHandle)nullptr; CheckError(lib3mf_resourceiterator_clone(m_pHandle, &hOutResourceIterator)); if (!hOutResourceIterator) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hOutResourceIterator); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hOutResourceIterator))); } /** @@ -2211,13 +4431,13 @@ public: */ PSliceStack CSliceStackIterator::GetCurrentSliceStack() { - Lib3MFHandle hResource = nullptr; + Lib3MFHandle hResource = (Lib3MFHandle)nullptr; CheckError(lib3mf_slicestackiterator_getcurrentslicestack(m_pHandle, &hResource)); if (!hResource) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResource); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } /** @@ -2230,13 +4450,13 @@ public: */ PObject CObjectIterator::GetCurrentObject() { - Lib3MFHandle hResource = nullptr; + Lib3MFHandle hResource = (Lib3MFHandle)nullptr; CheckError(lib3mf_objectiterator_getcurrentobject(m_pHandle, &hResource)); if (!hResource) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResource); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } /** @@ -2249,13 +4469,13 @@ public: */ PMeshObject CMeshObjectIterator::GetCurrentMeshObject() { - Lib3MFHandle hResource = nullptr; + Lib3MFHandle hResource = (Lib3MFHandle)nullptr; CheckError(lib3mf_meshobjectiterator_getcurrentmeshobject(m_pHandle, &hResource)); if (!hResource) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResource); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } /** @@ -2268,13 +4488,13 @@ public: */ PComponentsObject CComponentsObjectIterator::GetCurrentComponentsObject() { - Lib3MFHandle hResource = nullptr; + Lib3MFHandle hResource = (Lib3MFHandle)nullptr; CheckError(lib3mf_componentsobjectiterator_getcurrentcomponentsobject(m_pHandle, &hResource)); if (!hResource) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResource); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } /** @@ -2287,13 +4507,13 @@ public: */ PTexture2D CTexture2DIterator::GetCurrentTexture2D() { - Lib3MFHandle hResource = nullptr; + Lib3MFHandle hResource = (Lib3MFHandle)nullptr; CheckError(lib3mf_texture2diterator_getcurrenttexture2d(m_pHandle, &hResource)); if (!hResource) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResource); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } /** @@ -2306,13 +4526,13 @@ public: */ PBaseMaterialGroup CBaseMaterialGroupIterator::GetCurrentBaseMaterialGroup() { - Lib3MFHandle hResource = nullptr; + Lib3MFHandle hResource = (Lib3MFHandle)nullptr; CheckError(lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup(m_pHandle, &hResource)); if (!hResource) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResource); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } /** @@ -2325,13 +4545,13 @@ public: */ PColorGroup CColorGroupIterator::GetCurrentColorGroup() { - Lib3MFHandle hResource = nullptr; + Lib3MFHandle hResource = (Lib3MFHandle)nullptr; CheckError(lib3mf_colorgroupiterator_getcurrentcolorgroup(m_pHandle, &hResource)); if (!hResource) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResource); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } /** @@ -2344,13 +4564,13 @@ public: */ PTexture2DGroup CTexture2DGroupIterator::GetCurrentTexture2DGroup() { - Lib3MFHandle hResource = nullptr; + Lib3MFHandle hResource = (Lib3MFHandle)nullptr; CheckError(lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup(m_pHandle, &hResource)); if (!hResource) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResource); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } /** @@ -2363,13 +4583,13 @@ public: */ PCompositeMaterials CCompositeMaterialsIterator::GetCurrentCompositeMaterials() { - Lib3MFHandle hResource = nullptr; + Lib3MFHandle hResource = (Lib3MFHandle)nullptr; CheckError(lib3mf_compositematerialsiterator_getcurrentcompositematerials(m_pHandle, &hResource)); if (!hResource) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResource); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } /** @@ -2382,13 +4602,70 @@ public: */ PMultiPropertyGroup CMultiPropertyGroupIterator::GetCurrentMultiPropertyGroup() { - Lib3MFHandle hResource = nullptr; + Lib3MFHandle hResource = (Lib3MFHandle)nullptr; CheckError(lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup(m_pHandle, &hResource)); if (!hResource) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResource); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * Method definitions for class CImage3DIterator + */ + + /** + * CImage3DIterator::GetCurrentImage3D - Returns the Image3D the iterator points at. + * @return returns the Image3D instance. + */ + PImage3D CImage3DIterator::GetCurrentImage3D() + { + Lib3MFHandle hResource = (Lib3MFHandle)nullptr; + CheckError(lib3mf_image3diterator_getcurrentimage3d(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * Method definitions for class CFunctionIterator + */ + + /** + * CFunctionIterator::GetCurrentFunction - Returns the Function the iterator points at. + * @return returns the Function instance. + */ + PFunction CFunctionIterator::GetCurrentFunction() + { + Lib3MFHandle hResource = (Lib3MFHandle)nullptr; + CheckError(lib3mf_functioniterator_getcurrentfunction(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * Method definitions for class CLevelSetIterator + */ + + /** + * CLevelSetIterator::GetCurrentLevelSet - Returns the LevelSet the iterator points at. + * @return returns the MeshObject instance. + */ + PLevelSet CLevelSetIterator::GetCurrentLevelSet() + { + Lib3MFHandle hResource = (Lib3MFHandle)nullptr; + CheckError(lib3mf_levelsetiterator_getcurrentlevelset(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } /** @@ -2550,13 +4827,13 @@ public: */ PMetaData CMetaDataGroup::GetMetaData(const Lib3MF_uint32 nIndex) { - Lib3MFHandle hMetaData = nullptr; + Lib3MFHandle hMetaData = (Lib3MFHandle)nullptr; CheckError(lib3mf_metadatagroup_getmetadata(m_pHandle, nIndex, &hMetaData)); if (!hMetaData) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hMetaData); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaData))); } /** @@ -2567,13 +4844,13 @@ public: */ PMetaData CMetaDataGroup::GetMetaDataByKey(const std::string & sNameSpace, const std::string & sName) { - Lib3MFHandle hMetaData = nullptr; + Lib3MFHandle hMetaData = (Lib3MFHandle)nullptr; CheckError(lib3mf_metadatagroup_getmetadatabykey(m_pHandle, sNameSpace.c_str(), sName.c_str(), &hMetaData)); if (!hMetaData) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hMetaData); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaData))); } /** @@ -2589,12 +4866,9 @@ public: * CMetaDataGroup::RemoveMetaData - removes metadata from the model. * @param[in] pTheMetaData - The metadata to remove */ - void CMetaDataGroup::RemoveMetaData(CMetaData * pTheMetaData) + void CMetaDataGroup::RemoveMetaData(classParam pTheMetaData) { - Lib3MFHandle hTheMetaData = nullptr; - if (pTheMetaData != nullptr) { - hTheMetaData = pTheMetaData->GetHandle(); - }; + Lib3MFHandle hTheMetaData = pTheMetaData.GetHandle(); CheckError(lib3mf_metadatagroup_removemetadata(m_pHandle, hTheMetaData)); } @@ -2604,18 +4878,164 @@ public: * @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 + * @param[in] bMustPreserve - should 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; + Lib3MFHandle hMetaData = (Lib3MFHandle)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::make_shared(m_pWrapper, hMetaData); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaData))); + } + + /** + * Method definitions for class CTriangleSet + */ + + /** + * CTriangleSet::SetName - sets the name of the triangle set + * @param[in] sName - the new name + */ + void CTriangleSet::SetName(const std::string & sName) + { + CheckError(lib3mf_triangleset_setname(m_pHandle, sName.c_str())); + } + + /** + * CTriangleSet::GetName - returns the name of the triangle set + * @return returns the name + */ + std::string CTriangleSet::GetName() + { + Lib3MF_uint32 bytesNeededName = 0; + Lib3MF_uint32 bytesWrittenName = 0; + CheckError(lib3mf_triangleset_getname(m_pHandle, 0, &bytesNeededName, nullptr)); + std::vector bufferName(bytesNeededName); + CheckError(lib3mf_triangleset_getname(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + + return std::string(&bufferName[0]); + } + + /** + * CTriangleSet::SetIdentifier - sets the identifier of the triangle set. + * @param[in] sIdentifier - the new identifier. MUST be unique within the mesh. MUST NOT be an empty string + */ + void CTriangleSet::SetIdentifier(const std::string & sIdentifier) + { + CheckError(lib3mf_triangleset_setidentifier(m_pHandle, sIdentifier.c_str())); + } + + /** + * CTriangleSet::GetIdentifier - returns the identifier of the triangle set + * @return returns the identifier + */ + std::string CTriangleSet::GetIdentifier() + { + Lib3MF_uint32 bytesNeededIdentifier = 0; + Lib3MF_uint32 bytesWrittenIdentifier = 0; + CheckError(lib3mf_triangleset_getidentifier(m_pHandle, 0, &bytesNeededIdentifier, nullptr)); + std::vector bufferIdentifier(bytesNeededIdentifier); + CheckError(lib3mf_triangleset_getidentifier(m_pHandle, bytesNeededIdentifier, &bytesWrittenIdentifier, &bufferIdentifier[0])); + + return std::string(&bufferIdentifier[0]); + } + + /** + * CTriangleSet::AddTriangle - adds a triangle to the set. Does nothing if triangle is already in the set. + * @param[in] nTriangleIndex - Triangle index to add. MUST be between 0 and TriangleCount - 1. + */ + void CTriangleSet::AddTriangle(const Lib3MF_uint32 nTriangleIndex) + { + CheckError(lib3mf_triangleset_addtriangle(m_pHandle, nTriangleIndex)); + } + + /** + * CTriangleSet::RemoveTriangle - removes a triangle from the set + * @param[in] nTriangleIndex - Triangle index to remove. MUST be between 0 and TriangleCount - 1. + */ + void CTriangleSet::RemoveTriangle(const Lib3MF_uint32 nTriangleIndex) + { + CheckError(lib3mf_triangleset_removetriangle(m_pHandle, nTriangleIndex)); + } + + /** + * CTriangleSet::Clear - clears all triangles from the list + */ + void CTriangleSet::Clear() + { + CheckError(lib3mf_triangleset_clear(m_pHandle)); + } + + /** + * CTriangleSet::SetTriangleList - Sets all triangles in the list, while clearing old values. Duplicates will be merged. + * @param[in] TriangleIndicesBuffer - Triangle indices to add. Every element MUST be between 0 and TriangleCount - 1. + */ + void CTriangleSet::SetTriangleList(const CInputVector & TriangleIndicesBuffer) + { + Lib3MF_uint64 nTriangleIndicesSize = TriangleIndicesBuffer.size(); + CheckError(lib3mf_triangleset_settrianglelist(m_pHandle, nTriangleIndicesSize, TriangleIndicesBuffer.data())); + } + + /** + * CTriangleSet::GetTriangleList - Retrieves all the triangles in the TriangleSet + * @param[out] TriangleIndicesBuffer - retrieves the indices of the triangles in this TriangleSet + */ + void CTriangleSet::GetTriangleList(std::vector & TriangleIndicesBuffer) + { + Lib3MF_uint64 elementsNeededTriangleIndices = 0; + Lib3MF_uint64 elementsWrittenTriangleIndices = 0; + CheckError(lib3mf_triangleset_gettrianglelist(m_pHandle, 0, &elementsNeededTriangleIndices, nullptr)); + TriangleIndicesBuffer.resize((size_t) elementsNeededTriangleIndices); + CheckError(lib3mf_triangleset_gettrianglelist(m_pHandle, elementsNeededTriangleIndices, &elementsWrittenTriangleIndices, TriangleIndicesBuffer.data())); + } + + /** + * CTriangleSet::AddTriangleList - Adds multiple triangles in the list. Duplicates will be merged. + * @param[in] TriangleIndicesBuffer - Triangle indices to add. Every element MUST be between 0 and TriangleCount - 1. + */ + void CTriangleSet::AddTriangleList(const CInputVector & TriangleIndicesBuffer) + { + Lib3MF_uint64 nTriangleIndicesSize = TriangleIndicesBuffer.size(); + CheckError(lib3mf_triangleset_addtrianglelist(m_pHandle, nTriangleIndicesSize, TriangleIndicesBuffer.data())); + } + + /** + * CTriangleSet::Merge - Merges another Triangle set. + * @param[in] pOtherTriangleSet - Other triangle set to merge. + * @param[in] bDeleteOther - Flag if other triangle set is getting removed. + */ + void CTriangleSet::Merge(classParam pOtherTriangleSet, const bool bDeleteOther) + { + Lib3MFHandle hOtherTriangleSet = pOtherTriangleSet.GetHandle(); + CheckError(lib3mf_triangleset_merge(m_pHandle, hOtherTriangleSet, bDeleteOther)); + } + + /** + * CTriangleSet::DeleteSet - Deletes the whole set from the mesh. + */ + void CTriangleSet::DeleteSet() + { + CheckError(lib3mf_triangleset_deleteset(m_pHandle)); + } + + /** + * CTriangleSet::Duplicate - Duplicates the set in the mesh. + * @param[in] sIdentifier - the new identifier. MUST be unique within the mesh. MUST NOT be an empty string + * @return Copy of the triangle set. + */ + PTriangleSet CTriangleSet::Duplicate(const std::string & sIdentifier) + { + Lib3MFHandle hNewSet = (Lib3MFHandle)nullptr; + CheckError(lib3mf_triangleset_duplicate(m_pHandle, sIdentifier.c_str(), &hNewSet)); + + if (!hNewSet) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNewSet))); } /** @@ -2715,6 +5135,18 @@ public: return resultIsComponentsObject; } + /** + * CObject::IsLevelSetObject - Retrieves, if an object is a level set object + * @return returns, whether the object is a level set object + */ + bool CObject::IsLevelSetObject() + { + bool resultIsLevelSetObject = 0; + CheckError(lib3mf_object_islevelsetobject(m_pHandle, &resultIsLevelSetObject)); + + return resultIsLevelSetObject; + } + /** * 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 @@ -2731,12 +5163,9 @@ public: * 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(CAttachment * pAttachment) + void CObject::SetAttachmentAsThumbnail(classParam pAttachment) { - Lib3MFHandle hAttachment = nullptr; - if (pAttachment != nullptr) { - hAttachment = pAttachment->GetHandle(); - }; + Lib3MFHandle hAttachment = pAttachment.GetHandle(); CheckError(lib3mf_object_setattachmentasthumbnail(m_pHandle, hAttachment)); } @@ -2746,11 +5175,11 @@ public: */ PAttachment CObject::GetThumbnailAttachment() { - Lib3MFHandle hAttachment = nullptr; + Lib3MFHandle hAttachment = (Lib3MFHandle)nullptr; CheckError(lib3mf_object_getthumbnailattachment(m_pHandle, &hAttachment)); if (hAttachment) { - return std::make_shared(m_pWrapper, hAttachment); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttachment))); } else { return nullptr; } @@ -2807,13 +5236,13 @@ public: */ PMetaDataGroup CObject::GetMetaDataGroup() { - Lib3MFHandle hMetaDataGroup = nullptr; + Lib3MFHandle hMetaDataGroup = (Lib3MFHandle)nullptr; CheckError(lib3mf_object_getmetadatagroup(m_pHandle, &hMetaDataGroup)); if (!hMetaDataGroup) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hMetaDataGroup); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaDataGroup))); } /** @@ -2864,25 +5293,22 @@ public: */ PSliceStack CObject::GetSliceStack() { - Lib3MFHandle hSliceStackInstance = nullptr; + Lib3MFHandle hSliceStackInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_object_getslicestack(m_pHandle, &hSliceStackInstance)); if (!hSliceStackInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hSliceStackInstance); + 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(CSliceStack * pSliceStackInstance) + void CObject::AssignSliceStack(classParam pSliceStackInstance) { - Lib3MFHandle hSliceStackInstance = nullptr; - if (pSliceStackInstance != nullptr) { - hSliceStackInstance = pSliceStackInstance->GetHandle(); - }; + Lib3MFHandle hSliceStackInstance = pSliceStackInstance.GetHandle(); CheckError(lib3mf_object_assignslicestack(m_pHandle, hSliceStackInstance)); } @@ -3062,7 +5488,8 @@ public: */ void CMeshObject::SetAllTriangleProperties(const CInputVector & PropertiesArrayBuffer) { - CheckError(lib3mf_meshobject_setalltriangleproperties(m_pHandle, (Lib3MF_uint64)PropertiesArrayBuffer.size(), PropertiesArrayBuffer.data())); + Lib3MF_uint64 nPropertiesArraySize = PropertiesArrayBuffer.size(); + CheckError(lib3mf_meshobject_setalltriangleproperties(m_pHandle, nPropertiesArraySize, PropertiesArrayBuffer.data())); } /** @@ -3093,7 +5520,9 @@ public: */ 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())); + Lib3MF_uint64 nVerticesSize = VerticesBuffer.size(); + Lib3MF_uint64 nIndicesSize = IndicesBuffer.size(); + CheckError(lib3mf_meshobject_setgeometry(m_pHandle, nVerticesSize, VerticesBuffer.data(), nIndicesSize, IndicesBuffer.data())); } /** @@ -3114,13 +5543,303 @@ public: */ PBeamLattice CMeshObject::BeamLattice() { - Lib3MFHandle hTheBeamLattice = nullptr; + Lib3MFHandle hTheBeamLattice = (Lib3MFHandle)nullptr; CheckError(lib3mf_meshobject_beamlattice(m_pHandle, &hTheBeamLattice)); if (!hTheBeamLattice) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hTheBeamLattice); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheBeamLattice))); + } + + /** + * CMeshObject::GetVolumeData - Retrieves the VolumeData of this MeshObject. + * @return the VolumeData of this MeshObject + */ + PVolumeData CMeshObject::GetVolumeData() + { + Lib3MFHandle hTheVolumeData = (Lib3MFHandle)nullptr; + CheckError(lib3mf_meshobject_getvolumedata(m_pHandle, &hTheVolumeData)); + + if (hTheVolumeData) { + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheVolumeData))); + } else { + return nullptr; + } + } + + /** + * CMeshObject::SetVolumeData - Sets the VolumeData of this MeshObject. + * @param[in] pTheVolumeData - the VolumeData of this MeshObject + */ + void CMeshObject::SetVolumeData(classParam pTheVolumeData) + { + Lib3MFHandle hTheVolumeData = pTheVolumeData.GetHandle(); + CheckError(lib3mf_meshobject_setvolumedata(m_pHandle, hTheVolumeData)); + } + + /** + * CMeshObject::AddTriangleSet - Adds a new triangle set. + * @param[in] sIdentifier - the new identifier. MUST be unique within the mesh. MUST NOT be an empty string + * @param[in] sName - the human readable name. MUST NOT be an empty string + * @return the new Triangle Set Instance. + */ + PTriangleSet CMeshObject::AddTriangleSet(const std::string & sIdentifier, const std::string & sName) + { + Lib3MFHandle hTheTriangleSet = (Lib3MFHandle)nullptr; + CheckError(lib3mf_meshobject_addtriangleset(m_pHandle, sIdentifier.c_str(), sName.c_str(), &hTheTriangleSet)); + + if (!hTheTriangleSet) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheTriangleSet))); + } + + /** + * CMeshObject::HasTriangleSet - Checks if a triangle set exists. + * @param[in] sIdentifier - the identifier to be found. + * @return flag if the triangles set exists. + */ + bool CMeshObject::HasTriangleSet(const std::string & sIdentifier) + { + bool resultTriangleSetExists = 0; + CheckError(lib3mf_meshobject_hastriangleset(m_pHandle, sIdentifier.c_str(), &resultTriangleSetExists)); + + return resultTriangleSetExists; + } + + /** + * CMeshObject::FindTriangleSet - Finds a new triangle set by identifier. Fails if not existing. + * @param[in] sIdentifier - the identifier to be found. + * @return the triangle Set Instance. + */ + PTriangleSet CMeshObject::FindTriangleSet(const std::string & sIdentifier) + { + Lib3MFHandle hTheTriangleSet = (Lib3MFHandle)nullptr; + CheckError(lib3mf_meshobject_findtriangleset(m_pHandle, sIdentifier.c_str(), &hTheTriangleSet)); + + if (!hTheTriangleSet) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheTriangleSet))); + } + + /** + * CMeshObject::GetTriangleSetCount - Returns number of triangle sets. + * @return the number of triangle sets of this mesh. + */ + Lib3MF_uint32 CMeshObject::GetTriangleSetCount() + { + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_meshobject_gettrianglesetcount(m_pHandle, &resultCount)); + + return resultCount; + } + + /** + * CMeshObject::GetTriangleSet - Returns a specific triangle set by index. + * @param[in] nIndex - the index of the triangle set. + * @return the triangle Set Instance. + */ + PTriangleSet CMeshObject::GetTriangleSet(const Lib3MF_uint32 nIndex) + { + Lib3MFHandle hTheTriangleSet = (Lib3MFHandle)nullptr; + CheckError(lib3mf_meshobject_gettriangleset(m_pHandle, nIndex, &hTheTriangleSet)); + + if (!hTheTriangleSet) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheTriangleSet))); + } + + /** + * Method definitions for class CLevelSet + */ + + /** + * CLevelSet::GetFunction - Returns the function that is used as boundary shape. + * @return the function to use as boundary shape + */ + PFunction CLevelSet::GetFunction() + { + Lib3MFHandle hTheFunction = (Lib3MFHandle)nullptr; + CheckError(lib3mf_levelset_getfunction(m_pHandle, &hTheFunction)); + + if (hTheFunction) { + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheFunction))); + } else { + return nullptr; + } + } + + /** + * CLevelSet::SetFunction - Sets the function to use as boundary shape. + * @param[in] pTheFunction - the function to use as boundary shape + */ + void CLevelSet::SetFunction(classParam pTheFunction) + { + Lib3MFHandle hTheFunction = pTheFunction.GetHandle(); + CheckError(lib3mf_levelset_setfunction(m_pHandle, hTheFunction)); + } + + /** + * CLevelSet::GetTransform - Returns the transformation matrix into the coordinate system of the referenced Function. + * @return the transformation matrix + */ + sTransform CLevelSet::GetTransform() + { + sTransform resultTransform; + CheckError(lib3mf_levelset_gettransform(m_pHandle, &resultTransform)); + + return resultTransform; + } + + /** + * CLevelSet::SetTransform - Sets the transformation matrix into the coordinate system of the referenced Function. + * @param[in] Transform - new transformation matrix + */ + void CLevelSet::SetTransform(const sTransform & Transform) + { + CheckError(lib3mf_levelset_settransform(m_pHandle, &Transform)); + } + + /** + * CLevelSet::GetChannelName - Returns the name of the function output channel to use. + * @return the name of the function output channel + */ + std::string CLevelSet::GetChannelName() + { + Lib3MF_uint32 bytesNeededChannelName = 0; + Lib3MF_uint32 bytesWrittenChannelName = 0; + CheckError(lib3mf_levelset_getchannelname(m_pHandle, 0, &bytesNeededChannelName, nullptr)); + std::vector bufferChannelName(bytesNeededChannelName); + CheckError(lib3mf_levelset_getchannelname(m_pHandle, bytesNeededChannelName, &bytesWrittenChannelName, &bufferChannelName[0])); + + return std::string(&bufferChannelName[0]); + } + + /** + * CLevelSet::SetChannelName - Sets the name of the function output channel to use. + * @param[in] sChannelName - new name of the function output channel + */ + void CLevelSet::SetChannelName(const std::string & sChannelName) + { + CheckError(lib3mf_levelset_setchannelname(m_pHandle, sChannelName.c_str())); + } + + /** + * CLevelSet::SetMinFeatureSize - Sets the minimal feature size as a hint for the function evaluator + * @param[in] dMinFeatureSize - minimal feature size + */ + void CLevelSet::SetMinFeatureSize(const Lib3MF_double dMinFeatureSize) + { + CheckError(lib3mf_levelset_setminfeaturesize(m_pHandle, dMinFeatureSize)); + } + + /** + * CLevelSet::GetMinFeatureSize - Returns the minimal feature size as a hint for the function evaluator + * @return minimal feature size + */ + Lib3MF_double CLevelSet::GetMinFeatureSize() + { + Lib3MF_double resultMinFeatureSize = 0; + CheckError(lib3mf_levelset_getminfeaturesize(m_pHandle, &resultMinFeatureSize)); + + return resultMinFeatureSize; + } + + /** + * CLevelSet::SetFallBackValue - Sets the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). + * @param[in] dFallBackValue - fallback value + */ + void CLevelSet::SetFallBackValue(const Lib3MF_double dFallBackValue) + { + CheckError(lib3mf_levelset_setfallbackvalue(m_pHandle, dFallBackValue)); + } + + /** + * CLevelSet::GetFallBackValue - Returns the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). + * @return fallback value + */ + Lib3MF_double CLevelSet::GetFallBackValue() + { + Lib3MF_double resultFallBackValue = 0; + CheckError(lib3mf_levelset_getfallbackvalue(m_pHandle, &resultFallBackValue)); + + return resultFallBackValue; + } + + /** + * CLevelSet::SetMeshBBoxOnly - If set only the bounding box of the mesh is intersected with the boundary + * @param[in] bMeshBBoxOnly - If set only the bounding box of the mesh is intersected with the boundary + */ + void CLevelSet::SetMeshBBoxOnly(const bool bMeshBBoxOnly) + { + CheckError(lib3mf_levelset_setmeshbboxonly(m_pHandle, bMeshBBoxOnly)); + } + + /** + * CLevelSet::GetMeshBBoxOnly - If set only the bounding box of the mesh is intersected with the boundary + * @return If set only the bounding box of the mesh is intersected with the boundary + */ + bool CLevelSet::GetMeshBBoxOnly() + { + bool resultMeshBBoxOnly = 0; + CheckError(lib3mf_levelset_getmeshbboxonly(m_pHandle, &resultMeshBBoxOnly)); + + return resultMeshBBoxOnly; + } + + /** + * CLevelSet::SetMesh - Sets the mesh to use as evaluation domain + * @param[in] pTheMesh - The mesh + */ + void CLevelSet::SetMesh(classParam pTheMesh) + { + Lib3MFHandle hTheMesh = pTheMesh.GetHandle(); + CheckError(lib3mf_levelset_setmesh(m_pHandle, hTheMesh)); + } + + /** + * CLevelSet::GetMesh - Returns the mesh that is used as evaluation domain + * @return The mesh + */ + PMeshObject CLevelSet::GetMesh() + { + Lib3MFHandle hTheMesh = (Lib3MFHandle)nullptr; + CheckError(lib3mf_levelset_getmesh(m_pHandle, &hTheMesh)); + + if (hTheMesh) { + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheMesh))); + } else { + return nullptr; + } + } + + /** + * CLevelSet::GetVolumeData - Retrieves the VolumeData this Object. + * @return the VolumeData of this Object + */ + PVolumeData CLevelSet::GetVolumeData() + { + Lib3MFHandle hTheVolumeData = (Lib3MFHandle)nullptr; + CheckError(lib3mf_levelset_getvolumedata(m_pHandle, &hTheVolumeData)); + + if (hTheVolumeData) { + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheVolumeData))); + } else { + return nullptr; + } + } + + /** + * CLevelSet::SetVolumeData - Sets the VolumeData of this LevelSet. + * @param[in] pTheVolumeData - the VolumeData of this MeshObject + */ + void CLevelSet::SetVolumeData(classParam pTheVolumeData) + { + Lib3MFHandle hTheVolumeData = pTheVolumeData.GetHandle(); + CheckError(lib3mf_levelset_setvolumedata(m_pHandle, hTheVolumeData)); } /** @@ -3264,7 +5983,8 @@ public: */ void CBeamLattice::SetBeams(const CInputVector & BeamInfoBuffer) { - CheckError(lib3mf_beamlattice_setbeams(m_pHandle, (Lib3MF_uint64)BeamInfoBuffer.size(), BeamInfoBuffer.data())); + Lib3MF_uint64 nBeamInfoSize = BeamInfoBuffer.size(); + CheckError(lib3mf_beamlattice_setbeams(m_pHandle, nBeamInfoSize, BeamInfoBuffer.data())); } /** @@ -3334,7 +6054,8 @@ public: */ void CBeamLattice::SetBalls(const CInputVector & BallInfoBuffer) { - CheckError(lib3mf_beamlattice_setballs(m_pHandle, (Lib3MF_uint64)BallInfoBuffer.size(), BallInfoBuffer.data())); + Lib3MF_uint64 nBallInfoSize = BallInfoBuffer.size(); + CheckError(lib3mf_beamlattice_setballs(m_pHandle, nBallInfoSize, BallInfoBuffer.data())); } /** @@ -3368,13 +6089,13 @@ public: */ PBeamSet CBeamLattice::AddBeamSet() { - Lib3MFHandle hBeamSet = nullptr; + Lib3MFHandle hBeamSet = (Lib3MFHandle)nullptr; CheckError(lib3mf_beamlattice_addbeamset(m_pHandle, &hBeamSet)); if (!hBeamSet) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hBeamSet); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBeamSet))); } /** @@ -3384,13 +6105,394 @@ public: */ PBeamSet CBeamLattice::GetBeamSet(const Lib3MF_uint32 nIndex) { - Lib3MFHandle hBeamSet = nullptr; + Lib3MFHandle hBeamSet = (Lib3MFHandle)nullptr; CheckError(lib3mf_beamlattice_getbeamset(m_pHandle, nIndex, &hBeamSet)); if (!hBeamSet) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hBeamSet); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBeamSet))); + } + + /** + * Method definitions for class CFunctionReference + */ + + /** + * CFunctionReference::GetFunctionResourceID - Returns the UniqueResourceID of the Function. Only functions with a 'pos'-input are allowed. + * @return returns the UniqueResourceID. + */ + Lib3MF_uint32 CFunctionReference::GetFunctionResourceID() + { + Lib3MF_uint32 resultUniqueResourceID = 0; + CheckError(lib3mf_functionreference_getfunctionresourceid(m_pHandle, &resultUniqueResourceID)); + + return resultUniqueResourceID; + } + + /** + * CFunctionReference::SetFunctionResourceID - Sets the UniqueResourceID to refer to. + * @param[in] nUniqueResourceID - UniqueResourceID of the function + */ + void CFunctionReference::SetFunctionResourceID(const Lib3MF_uint32 nUniqueResourceID) + { + CheckError(lib3mf_functionreference_setfunctionresourceid(m_pHandle, nUniqueResourceID)); + } + + /** + * CFunctionReference::GetTransform - Returns the transformation matrix into the coordinate system of the referenced Function. + * @return the transformation matrix + */ + sTransform CFunctionReference::GetTransform() + { + sTransform resultTransform; + CheckError(lib3mf_functionreference_gettransform(m_pHandle, &resultTransform)); + + return resultTransform; + } + + /** + * CFunctionReference::SetTransform - Sets the transformation matrix into the coordinate system of the referenced Function. + * @param[in] Transform - new transformation matrix + */ + void CFunctionReference::SetTransform(const sTransform & Transform) + { + CheckError(lib3mf_functionreference_settransform(m_pHandle, &Transform)); + } + + /** + * CFunctionReference::GetChannelName - Returns the name of the function output channel to use. + * @return the name of the function output channel + */ + std::string CFunctionReference::GetChannelName() + { + Lib3MF_uint32 bytesNeededChannelName = 0; + Lib3MF_uint32 bytesWrittenChannelName = 0; + CheckError(lib3mf_functionreference_getchannelname(m_pHandle, 0, &bytesNeededChannelName, nullptr)); + std::vector bufferChannelName(bytesNeededChannelName); + CheckError(lib3mf_functionreference_getchannelname(m_pHandle, bytesNeededChannelName, &bytesWrittenChannelName, &bufferChannelName[0])); + + return std::string(&bufferChannelName[0]); + } + + /** + * CFunctionReference::SetChannelName - Sets the name of the function output channel to use. + * @param[in] sChannelName - new name of the function output channel + */ + void CFunctionReference::SetChannelName(const std::string & sChannelName) + { + CheckError(lib3mf_functionreference_setchannelname(m_pHandle, sChannelName.c_str())); + } + + /** + * CFunctionReference::SetMinFeatureSize - Sets the minimal feature size as a hint for the function evaluator + * @param[in] dMinFeatureSize - minimal feature size + */ + void CFunctionReference::SetMinFeatureSize(const Lib3MF_double dMinFeatureSize) + { + CheckError(lib3mf_functionreference_setminfeaturesize(m_pHandle, dMinFeatureSize)); + } + + /** + * CFunctionReference::GetMinFeatureSize - Returns the minimal feature size as a hint for the function evaluator + * @return minimal feature size + */ + Lib3MF_double CFunctionReference::GetMinFeatureSize() + { + Lib3MF_double resultMinFeatureSize = 0; + CheckError(lib3mf_functionreference_getminfeaturesize(m_pHandle, &resultMinFeatureSize)); + + return resultMinFeatureSize; + } + + /** + * CFunctionReference::SetFallBackValue - Sets the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). + * @param[in] dFallBackValue - fallback value + */ + void CFunctionReference::SetFallBackValue(const Lib3MF_double dFallBackValue) + { + CheckError(lib3mf_functionreference_setfallbackvalue(m_pHandle, dFallBackValue)); + } + + /** + * CFunctionReference::GetFallBackValue - Returns the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). + * @return fallback value + */ + Lib3MF_double CFunctionReference::GetFallBackValue() + { + Lib3MF_double resultFallBackValue = 0; + CheckError(lib3mf_functionreference_getfallbackvalue(m_pHandle, &resultFallBackValue)); + + return resultFallBackValue; + } + + /** + * Method definitions for class CVolumeDataColor + */ + + /** + * Method definitions for class CMaterialMapping + */ + + /** + * Method definitions for class CVolumeDataComposite + */ + + /** + * CVolumeDataComposite::GetBaseMaterialGroup - Returns the BaseMaterialGroup used within this volume data item + * @return The BaseMaterialGroup instance of this VolumeDataComposite element + */ + PBaseMaterialGroup CVolumeDataComposite::GetBaseMaterialGroup() + { + Lib3MFHandle hBaseMaterialGroupInstance = (Lib3MFHandle)nullptr; + CheckError(lib3mf_volumedatacomposite_getbasematerialgroup(m_pHandle, &hBaseMaterialGroupInstance)); + + if (!hBaseMaterialGroupInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBaseMaterialGroupInstance))); + } + + /** + * CVolumeDataComposite::SetBaseMaterialGroup - Sets the BaseMaterialGroup to use within this volume data item. + * @param[in] pBaseMaterialGroupInstance - The new BaseMaterialGroup instance of this VolumeDataComposite element + */ + void CVolumeDataComposite::SetBaseMaterialGroup(classParam pBaseMaterialGroupInstance) + { + Lib3MFHandle hBaseMaterialGroupInstance = pBaseMaterialGroupInstance.GetHandle(); + CheckError(lib3mf_volumedatacomposite_setbasematerialgroup(m_pHandle, hBaseMaterialGroupInstance)); + } + + /** + * CVolumeDataComposite::GetMaterialMappingCount - Returns the number of material mappings of this VolumeDataComposite element + * @return the number of material mappings. + */ + Lib3MF_uint32 CVolumeDataComposite::GetMaterialMappingCount() + { + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_volumedatacomposite_getmaterialmappingcount(m_pHandle, &resultCount)); + + return resultCount; + } + + /** + * CVolumeDataComposite::GetMaterialMapping - Returns MaterialMapping with given index + * @param[in] nIndex - Index of the MaterialMapping in question. + * @return MaterialMapping used in this element + */ + PMaterialMapping CVolumeDataComposite::GetMaterialMapping(const Lib3MF_uint32 nIndex) + { + Lib3MFHandle hTheMaterialMapping = (Lib3MFHandle)nullptr; + CheckError(lib3mf_volumedatacomposite_getmaterialmapping(m_pHandle, nIndex, &hTheMaterialMapping)); + + if (!hTheMaterialMapping) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheMaterialMapping))); + } + + /** + * CVolumeDataComposite::AddMaterialMapping - Adds a MaterialMapping + * @param[in] Transform - new transformation matrix + * @return The new MaterialMapping + */ + PMaterialMapping CVolumeDataComposite::AddMaterialMapping(const sTransform & Transform) + { + Lib3MFHandle hTheMaterialMapping = (Lib3MFHandle)nullptr; + CheckError(lib3mf_volumedatacomposite_addmaterialmapping(m_pHandle, &Transform, &hTheMaterialMapping)); + + if (!hTheMaterialMapping) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheMaterialMapping))); + } + + /** + * CVolumeDataComposite::RemoveMaterialMapping - Removes the MaterialMapping with given index + * @param[in] nIndex - The index of the MaterialMapping to be removed. + */ + void CVolumeDataComposite::RemoveMaterialMapping(const Lib3MF_uint32 nIndex) + { + CheckError(lib3mf_volumedatacomposite_removematerialmapping(m_pHandle, nIndex)); + } + + /** + * Method definitions for class CVolumeDataProperty + */ + + /** + * CVolumeDataProperty::GetName - Gets the qualified name of this property. + * @return The qualified name of this property. + */ + std::string CVolumeDataProperty::GetName() + { + Lib3MF_uint32 bytesNeededPropertyName = 0; + Lib3MF_uint32 bytesWrittenPropertyName = 0; + CheckError(lib3mf_volumedataproperty_getname(m_pHandle, 0, &bytesNeededPropertyName, nullptr)); + std::vector bufferPropertyName(bytesNeededPropertyName); + CheckError(lib3mf_volumedataproperty_getname(m_pHandle, bytesNeededPropertyName, &bytesWrittenPropertyName, &bufferPropertyName[0])); + + return std::string(&bufferPropertyName[0]); + } + + /** + * CVolumeDataProperty::SetIsRequired - Sets whether this property is required to process this 3MF document instance. + * @param[in] bIsRequired - New value for whether this property is required to process this 3MF document instance. + */ + void CVolumeDataProperty::SetIsRequired(const bool bIsRequired) + { + CheckError(lib3mf_volumedataproperty_setisrequired(m_pHandle, bIsRequired)); + } + + /** + * CVolumeDataProperty::IsRequired - Returns whether this property is required to process this 3MF document instance. + * @return Is this property required to process this 3MF document instance? + */ + bool CVolumeDataProperty::IsRequired() + { + bool resultIsRequired = 0; + CheckError(lib3mf_volumedataproperty_isrequired(m_pHandle, &resultIsRequired)); + + return resultIsRequired; + } + + /** + * Method definitions for class CVolumeData + */ + + /** + * CVolumeData::GetComposite - Returns the VolumeDataComposite of this VolumeData instance + * @return filled with the VolumeDataComposite of this VolumeData instance. + */ + PVolumeDataComposite CVolumeData::GetComposite() + { + Lib3MFHandle hTheCompositeData = (Lib3MFHandle)nullptr; + CheckError(lib3mf_volumedata_getcomposite(m_pHandle, &hTheCompositeData)); + + if (hTheCompositeData) { + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheCompositeData))); + } else { + return nullptr; + } + } + + /** + * CVolumeData::CreateNewComposite - Creates a new VolumeDataComposite for this VolumeData instance + * @return The new VolumeDataComposite of this VolumeData instance. + */ + PVolumeDataComposite CVolumeData::CreateNewComposite() + { + Lib3MFHandle hTheCompositeData = (Lib3MFHandle)nullptr; + CheckError(lib3mf_volumedata_createnewcomposite(m_pHandle, &hTheCompositeData)); + + if (!hTheCompositeData) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheCompositeData))); + } + + /** + * CVolumeData::RemoveComposite - Removes the VolumeDataComposite of this VolumeData instance + */ + void CVolumeData::RemoveComposite() + { + CheckError(lib3mf_volumedata_removecomposite(m_pHandle)); + } + + /** + * CVolumeData::GetColor - Returns the VolumeDataColor of this VolumeData instance + * @return filled with the VolumeDataColor of this VolumeData instance. + */ + PVolumeDataColor CVolumeData::GetColor() + { + Lib3MFHandle hTheColorData = (Lib3MFHandle)nullptr; + CheckError(lib3mf_volumedata_getcolor(m_pHandle, &hTheColorData)); + + if (hTheColorData) { + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheColorData))); + } else { + return nullptr; + } + } + + /** + * CVolumeData::CreateNewColor - Creates a new VolumeDataColor for this VolumeData instance + * @param[in] pTheFunction - Function used in this element + * @return The new VolumeDataColor of this VolumeData instance. + */ + PVolumeDataColor CVolumeData::CreateNewColor(classParam pTheFunction) + { + Lib3MFHandle hTheFunction = pTheFunction.GetHandle(); + Lib3MFHandle hTheColorData = (Lib3MFHandle)nullptr; + CheckError(lib3mf_volumedata_createnewcolor(m_pHandle, hTheFunction, &hTheColorData)); + + if (!hTheColorData) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheColorData))); + } + + /** + * CVolumeData::RemoveColor - Removes the VolumeDataColor of this VolumeData instance + */ + void CVolumeData::RemoveColor() + { + CheckError(lib3mf_volumedata_removecolor(m_pHandle)); + } + + /** + * CVolumeData::GetPropertyCount - Returns the number of VolumeDataProperty + * @return the number of VolumeDataProperty-elements within this VolumeData + */ + Lib3MF_uint32 CVolumeData::GetPropertyCount() + { + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_volumedata_getpropertycount(m_pHandle, &resultCount)); + + return resultCount; + } + + /** + * CVolumeData::GetProperty - Returns the VolumeDataProperty at a given Index + * @param[in] nIndex - the index of the VolumeDataProperty to be returned. + * @return the VolumeDataProperty at the given index. + */ + PVolumeDataProperty CVolumeData::GetProperty(const Lib3MF_uint32 nIndex) + { + Lib3MFHandle hTheVolumeDataProperty = (Lib3MFHandle)nullptr; + CheckError(lib3mf_volumedata_getproperty(m_pHandle, nIndex, &hTheVolumeDataProperty)); + + if (!hTheVolumeDataProperty) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheVolumeDataProperty))); + } + + /** + * CVolumeData::AddPropertyFromFunction - Adds a new VolumeDataProperty from a Function + * @param[in] sName - the qualified name (namespace+name) of the Property + * @param[in] pTheFunction - Function used in this element + * @return the newly created VolumeDataProperty. + */ + PVolumeDataProperty CVolumeData::AddPropertyFromFunction(const std::string & sName, classParam pTheFunction) + { + Lib3MFHandle hTheFunction = pTheFunction.GetHandle(); + Lib3MFHandle hTheVolumeDataProperty = (Lib3MFHandle)nullptr; + CheckError(lib3mf_volumedata_addpropertyfromfunction(m_pHandle, sName.c_str(), hTheFunction, &hTheVolumeDataProperty)); + + if (!hTheVolumeDataProperty) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheVolumeDataProperty))); + } + + /** + * CVolumeData::RemoveProperty - Removes the VolumeDataProperty with a given index + * @param[in] nIndex - the index of the VolumeDataProperty to be removed. + */ + void CVolumeData::RemoveProperty(const Lib3MF_uint32 nIndex) + { + CheckError(lib3mf_volumedata_removeproperty(m_pHandle, nIndex)); } /** @@ -3403,13 +6505,13 @@ public: */ PObject CComponent::GetObjectResource() { - Lib3MFHandle hObjectResource = nullptr; + Lib3MFHandle hObjectResource = (Lib3MFHandle)nullptr; CheckError(lib3mf_component_getobjectresource(m_pHandle, &hObjectResource)); if (!hObjectResource) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hObjectResource); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hObjectResource))); } /** @@ -3492,19 +6594,16 @@ public: * @param[in] Transform - optional transform matrix for the component. * @return new component instance */ - PComponent CComponentsObject::AddComponent(CObject * pObjectResource, const sTransform & Transform) + PComponent CComponentsObject::AddComponent(classParam pObjectResource, const sTransform & Transform) { - Lib3MFHandle hObjectResource = nullptr; - if (pObjectResource != nullptr) { - hObjectResource = pObjectResource->GetHandle(); - }; - Lib3MFHandle hComponentInstance = nullptr; + Lib3MFHandle hObjectResource = pObjectResource.GetHandle(); + Lib3MFHandle hComponentInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_componentsobject_addcomponent(m_pHandle, hObjectResource, &Transform, &hComponentInstance)); if (!hComponentInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hComponentInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hComponentInstance))); } /** @@ -3514,13 +6613,13 @@ public: */ PComponent CComponentsObject::GetComponent(const Lib3MF_uint32 nIndex) { - Lib3MFHandle hComponentInstance = nullptr; + Lib3MFHandle hComponentInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_componentsobject_getcomponent(m_pHandle, nIndex, &hComponentInstance)); if (!hComponentInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hComponentInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hComponentInstance))); } /** @@ -3605,7 +6704,8 @@ public: */ void CBeamSet::SetReferences(const CInputVector & ReferencesBuffer) { - CheckError(lib3mf_beamset_setreferences(m_pHandle, (Lib3MF_uint64)ReferencesBuffer.size(), ReferencesBuffer.data())); + Lib3MF_uint64 nReferencesSize = ReferencesBuffer.size(); + CheckError(lib3mf_beamset_setreferences(m_pHandle, nReferencesSize, ReferencesBuffer.data())); } /** @@ -3639,7 +6739,8 @@ public: */ void CBeamSet::SetBallReferences(const CInputVector & BallReferencesBuffer) { - CheckError(lib3mf_beamset_setballreferences(m_pHandle, (Lib3MF_uint64)BallReferencesBuffer.size(), BallReferencesBuffer.data())); + Lib3MF_uint64 nBallReferencesSize = BallReferencesBuffer.size(); + CheckError(lib3mf_beamset_setballreferences(m_pHandle, nBallReferencesSize, BallReferencesBuffer.data())); } /** @@ -3900,13 +7001,13 @@ public: */ PTexture2D CTexture2DGroup::GetTexture2D() { - Lib3MFHandle hTexture2DInstance = nullptr; + Lib3MFHandle hTexture2DInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_texture2dgroup_gettexture2d(m_pHandle, &hTexture2DInstance)); if (!hTexture2DInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hTexture2DInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTexture2DInstance))); } /** @@ -3944,13 +7045,13 @@ public: */ PBaseMaterialGroup CCompositeMaterials::GetBaseMaterialGroup() { - Lib3MFHandle hBaseMaterialGroupInstance = nullptr; + Lib3MFHandle hBaseMaterialGroupInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_compositematerials_getbasematerialgroup(m_pHandle, &hBaseMaterialGroupInstance)); if (!hBaseMaterialGroupInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hBaseMaterialGroupInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBaseMaterialGroupInstance))); } /** @@ -3960,8 +7061,9 @@ public: */ Lib3MF_uint32 CCompositeMaterials::AddComposite(const CInputVector & CompositeBuffer) { + Lib3MF_uint64 nCompositeSize = CompositeBuffer.size(); Lib3MF_uint32 resultPropertyID = 0; - CheckError(lib3mf_compositematerials_addcomposite(m_pHandle, (Lib3MF_uint64)CompositeBuffer.size(), CompositeBuffer.data(), &resultPropertyID)); + CheckError(lib3mf_compositematerials_addcomposite(m_pHandle, nCompositeSize, CompositeBuffer.data(), &resultPropertyID)); return resultPropertyID; } @@ -4025,8 +7127,9 @@ public: */ Lib3MF_uint32 CMultiPropertyGroup::AddMultiProperty(const CInputVector & PropertyIDsBuffer) { + Lib3MF_uint64 nPropertyIDsSize = PropertyIDsBuffer.size(); Lib3MF_uint32 resultPropertyID = 0; - CheckError(lib3mf_multipropertygroup_addmultiproperty(m_pHandle, (Lib3MF_uint64)PropertyIDsBuffer.size(), PropertyIDsBuffer.data(), &resultPropertyID)); + CheckError(lib3mf_multipropertygroup_addmultiproperty(m_pHandle, nPropertyIDsSize, PropertyIDsBuffer.data(), &resultPropertyID)); return resultPropertyID; } @@ -4038,7 +7141,8 @@ public: */ void CMultiPropertyGroup::SetMultiProperty(const Lib3MF_uint32 nPropertyID, const CInputVector & PropertyIDsBuffer) { - CheckError(lib3mf_multipropertygroup_setmultiproperty(m_pHandle, nPropertyID, (Lib3MF_uint64)PropertyIDsBuffer.size(), PropertyIDsBuffer.data())); + Lib3MF_uint64 nPropertyIDsSize = PropertyIDsBuffer.size(); + CheckError(lib3mf_multipropertygroup_setmultiproperty(m_pHandle, nPropertyID, nPropertyIDsSize, PropertyIDsBuffer.data())); } /** @@ -4111,6 +7215,185 @@ public: CheckError(lib3mf_multipropertygroup_removelayer(m_pHandle, nLayerIndex)); } + /** + * Method definitions for class CImage3D + */ + + /** + * CImage3D::GetName - returns the name of this Image3D + * @return the name of this Image3D + */ + std::string CImage3D::GetName() + { + Lib3MF_uint32 bytesNeededName = 0; + Lib3MF_uint32 bytesWrittenName = 0; + CheckError(lib3mf_image3d_getname(m_pHandle, 0, &bytesNeededName, nullptr)); + std::vector bufferName(bytesNeededName); + CheckError(lib3mf_image3d_getname(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + + return std::string(&bufferName[0]); + } + + /** + * CImage3D::SetName - sets a new name of this Image3D + * @param[in] sName - the new name of this Image3D + */ + void CImage3D::SetName(const std::string & sName) + { + CheckError(lib3mf_image3d_setname(m_pHandle, sName.c_str())); + } + + /** + * CImage3D::IsImageStack - Retrieves, if this Image3D is a ImageStack + * @return returns, whether the Image3D is an ImageStack + */ + bool CImage3D::IsImageStack() + { + bool resultIsImageStack = 0; + CheckError(lib3mf_image3d_isimagestack(m_pHandle, &resultIsImageStack)); + + return resultIsImageStack; + } + + /** + * Method definitions for class CImageStack + */ + + /** + * CImageStack::GetRowCount - Retrieves the number of rows in each image of this image3d + * @return number of rows + */ + Lib3MF_uint32 CImageStack::GetRowCount() + { + Lib3MF_uint32 resultRowCount = 0; + CheckError(lib3mf_imagestack_getrowcount(m_pHandle, &resultRowCount)); + + return resultRowCount; + } + + /** + * CImageStack::SetRowCount - Sets the number of rows in each image of this image3d + * @param[in] nRowCount - number of rows + */ + void CImageStack::SetRowCount(const Lib3MF_uint32 nRowCount) + { + CheckError(lib3mf_imagestack_setrowcount(m_pHandle, nRowCount)); + } + + /** + * CImageStack::GetColumnCount - Retrieves the number of columns in each image of this image3d + * @return number of columns + */ + Lib3MF_uint32 CImageStack::GetColumnCount() + { + Lib3MF_uint32 resultColumnCount = 0; + CheckError(lib3mf_imagestack_getcolumncount(m_pHandle, &resultColumnCount)); + + return resultColumnCount; + } + + /** + * CImageStack::SetColumnCount - Sets the number of columns in each image of this image3d + * @param[in] nColumnCount - number of columns + */ + void CImageStack::SetColumnCount(const Lib3MF_uint32 nColumnCount) + { + CheckError(lib3mf_imagestack_setcolumncount(m_pHandle, nColumnCount)); + } + + /** + * CImageStack::GetSheetCount - Retrieves the number of images in the stack. + * @return number of images + */ + Lib3MF_uint32 CImageStack::GetSheetCount() + { + Lib3MF_uint32 resultSheetCount = 0; + CheckError(lib3mf_imagestack_getsheetcount(m_pHandle, &resultSheetCount)); + + return resultSheetCount; + } + + /** + * CImageStack::GetSheet - Retrieves a sheet of the stack. Raises an error if sheet is not set. + * @param[in] nIndex - index of the image (0-based) + * @return attachment containing the image + */ + PAttachment CImageStack::GetSheet(const Lib3MF_uint32 nIndex) + { + Lib3MFHandle hSheet = (Lib3MFHandle)nullptr; + CheckError(lib3mf_imagestack_getsheet(m_pHandle, nIndex, &hSheet)); + + if (!hSheet) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hSheet))); + } + + /** + * CImageStack::SetSheet - Sets a sheet to an existing attachment. + * @param[in] nIndex - index of the image (0-based) + * @param[in] pSheet - attachment containing the image + */ + void CImageStack::SetSheet(const Lib3MF_uint32 nIndex, classParam pSheet) + { + Lib3MFHandle hSheet = pSheet.GetHandle(); + CheckError(lib3mf_imagestack_setsheet(m_pHandle, nIndex, hSheet)); + } + + /** + * CImageStack::CreateEmptySheet - Creates a new sheet attachment with empty data. + * @param[in] nIndex - index of the image (0-based) + * @param[in] sPath - path of part in the package + * @return attachment containing the image + */ + PAttachment CImageStack::CreateEmptySheet(const Lib3MF_uint32 nIndex, const std::string & sPath) + { + Lib3MFHandle hSheet = (Lib3MFHandle)nullptr; + CheckError(lib3mf_imagestack_createemptysheet(m_pHandle, nIndex, sPath.c_str(), &hSheet)); + + if (!hSheet) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hSheet))); + } + + /** + * CImageStack::CreateSheetFromBuffer - Creates a new sheet attachment from a memory buffer. + * @param[in] nIndex - index of the image (0-based) + * @param[in] sPath - path of part in the package + * @param[in] DataBuffer - binary image data + * @return attachment containing the image + */ + PAttachment CImageStack::CreateSheetFromBuffer(const Lib3MF_uint32 nIndex, const std::string & sPath, const CInputVector & DataBuffer) + { + Lib3MF_uint64 nDataSize = DataBuffer.size(); + Lib3MFHandle hSheet = (Lib3MFHandle)nullptr; + CheckError(lib3mf_imagestack_createsheetfrombuffer(m_pHandle, nIndex, sPath.c_str(), nDataSize, DataBuffer.data(), &hSheet)); + + if (!hSheet) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hSheet))); + } + + /** + * CImageStack::CreateSheetFromFile - Creates a new sheet attachment from a file on disk. + * @param[in] nIndex - index of the image (0-based) + * @param[in] sPath - path of part in the package + * @param[in] sFileName - file name to read from + * @return attachment containing the image + */ + PAttachment CImageStack::CreateSheetFromFile(const Lib3MF_uint32 nIndex, const std::string & sPath, const std::string & sFileName) + { + Lib3MFHandle hSheet = (Lib3MFHandle)nullptr; + CheckError(lib3mf_imagestack_createsheetfromfile(m_pHandle, nIndex, sPath.c_str(), sFileName.c_str(), &hSheet)); + + if (!hSheet) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hSheet))); + } + /** * Method definitions for class CAttachment */ @@ -4145,13 +7428,13 @@ public: */ PPackagePart CAttachment::PackagePart() { - Lib3MFHandle hPackagePart = nullptr; + Lib3MFHandle hPackagePart = (Lib3MFHandle)nullptr; CheckError(lib3mf_attachment_packagepart(m_pHandle, &hPackagePart)); if (!hPackagePart) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hPackagePart); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPackagePart))); } /** @@ -4188,7 +7471,7 @@ public: } /** - * 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 packege, or via the WriteToFile or WriteToBuffer-methods. + * 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 CAttachment::ReadFromFile(const std::string & sFileName) @@ -4197,7 +7480,7 @@ public: } /** - * CAttachment::ReadFromCallback - Reads a model and from the data provided by a callback function + * 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. @@ -4234,12 +7517,13 @@ public: } /** - * CAttachment::ReadFromBuffer - Reads an attachment from a memory buffer + * CAttachment::ReadFromBuffer - Reads an attachment from a memory buffer. This buffer is immediately read (in contrast to the ReadFromCallback and ReadFromFile-methods). * @param[in] BufferBuffer - Buffer to read from */ void CAttachment::ReadFromBuffer(const CInputVector & BufferBuffer) { - CheckError(lib3mf_attachment_readfrombuffer(m_pHandle, (Lib3MF_uint64)BufferBuffer.size(), BufferBuffer.data())); + Lib3MF_uint64 nBufferSize = BufferBuffer.size(); + CheckError(lib3mf_attachment_readfrombuffer(m_pHandle, nBufferSize, BufferBuffer.data())); } /** @@ -4252,25 +7536,22 @@ public: */ PAttachment CTexture2D::GetAttachment() { - Lib3MFHandle hAttachment = nullptr; + Lib3MFHandle hAttachment = (Lib3MFHandle)nullptr; CheckError(lib3mf_texture2d_getattachment(m_pHandle, &hAttachment)); if (!hAttachment) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hAttachment); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttachment))); } /** * 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. */ - void CTexture2D::SetAttachment(CAttachment * pAttachment) + void CTexture2D::SetAttachment(classParam pAttachment) { - Lib3MFHandle hAttachment = nullptr; - if (pAttachment != nullptr) { - hAttachment = pAttachment->GetHandle(); - }; + Lib3MFHandle hAttachment = pAttachment.GetHandle(); CheckError(lib3mf_texture2d_setattachment(m_pHandle, hAttachment)); } @@ -4336,6 +7617,3151 @@ public: CheckError(lib3mf_texture2d_setfilter(m_pHandle, eFilter)); } + /** + * Method definitions for class CImplicitPort + */ + + /** + * CImplicitPort::GetIdentifier - Retrieves the identifier of the port + * @return the identifier + */ + std::string CImplicitPort::GetIdentifier() + { + Lib3MF_uint32 bytesNeededIdentifier = 0; + Lib3MF_uint32 bytesWrittenIdentifier = 0; + CheckError(lib3mf_implicitport_getidentifier(m_pHandle, 0, &bytesNeededIdentifier, nullptr)); + std::vector bufferIdentifier(bytesNeededIdentifier); + CheckError(lib3mf_implicitport_getidentifier(m_pHandle, bytesNeededIdentifier, &bytesWrittenIdentifier, &bufferIdentifier[0])); + + return std::string(&bufferIdentifier[0]); + } + + /** + * CImplicitPort::SetIdentifier - Sets the identifier of the port + * @param[in] sIdentifier - the identifier + */ + void CImplicitPort::SetIdentifier(const std::string & sIdentifier) + { + CheckError(lib3mf_implicitport_setidentifier(m_pHandle, sIdentifier.c_str())); + } + + /** + * CImplicitPort::GetDisplayName - Retrieves the display name of the port + * @return the display name + */ + std::string CImplicitPort::GetDisplayName() + { + Lib3MF_uint32 bytesNeededDisplayName = 0; + Lib3MF_uint32 bytesWrittenDisplayName = 0; + CheckError(lib3mf_implicitport_getdisplayname(m_pHandle, 0, &bytesNeededDisplayName, nullptr)); + std::vector bufferDisplayName(bytesNeededDisplayName); + CheckError(lib3mf_implicitport_getdisplayname(m_pHandle, bytesNeededDisplayName, &bytesWrittenDisplayName, &bufferDisplayName[0])); + + return std::string(&bufferDisplayName[0]); + } + + /** + * CImplicitPort::SetDisplayName - Sets the display name of the port + * @param[in] sDisplayName - the display name + */ + void CImplicitPort::SetDisplayName(const std::string & sDisplayName) + { + CheckError(lib3mf_implicitport_setdisplayname(m_pHandle, sDisplayName.c_str())); + } + + /** + * CImplicitPort::SetType - Sets the type of the port + * @param[in] eImplicitPortType - the type + */ + void CImplicitPort::SetType(const eImplicitPortType eImplicitPortType) + { + CheckError(lib3mf_implicitport_settype(m_pHandle, eImplicitPortType)); + } + + /** + * CImplicitPort::GetType - Retrieves the type of the port + * @return the type + */ + eImplicitPortType CImplicitPort::GetType() + { + eImplicitPortType resultImplicitPortType = (eImplicitPortType) 0; + CheckError(lib3mf_implicitport_gettype(m_pHandle, &resultImplicitPortType)); + + return resultImplicitPortType; + } + + /** + * CImplicitPort::GetReference - Retrieves the reference of the port, only used for input ports + * @return the reference + */ + std::string CImplicitPort::GetReference() + { + Lib3MF_uint32 bytesNeededReference = 0; + Lib3MF_uint32 bytesWrittenReference = 0; + CheckError(lib3mf_implicitport_getreference(m_pHandle, 0, &bytesNeededReference, nullptr)); + std::vector bufferReference(bytesNeededReference); + CheckError(lib3mf_implicitport_getreference(m_pHandle, bytesNeededReference, &bytesWrittenReference, &bufferReference[0])); + + return std::string(&bufferReference[0]); + } + + /** + * CImplicitPort::SetReference - Sets the reference of the port, only used for input ports + * @param[in] sReference - the reference + */ + void CImplicitPort::SetReference(const std::string & sReference) + { + CheckError(lib3mf_implicitport_setreference(m_pHandle, sReference.c_str())); + } + + /** + * Method definitions for class CIterator + */ + + /** + * CIterator::MoveNext - Iterates to the next item in the list. + * @return Iterates to the next item in the list. + */ + bool CIterator::MoveNext() + { + bool resultHasNext = 0; + CheckError(lib3mf_iterator_movenext(m_pHandle, &resultHasNext)); + + return resultHasNext; + } + + /** + * CIterator::MovePrevious - Iterates to the previous item in the list. + * @return Iterates to the previous item in the list. + */ + bool CIterator::MovePrevious() + { + bool resultHasPrevious = 0; + CheckError(lib3mf_iterator_moveprevious(m_pHandle, &resultHasPrevious)); + + return resultHasPrevious; + } + + /** + * CIterator::Count - Returns the number of items the iterator captures. + * @return returns the number of items the iterator captures. + */ + Lib3MF_uint64 CIterator::Count() + { + Lib3MF_uint64 resultCount = 0; + CheckError(lib3mf_iterator_count(m_pHandle, &resultCount)); + + return resultCount; + } + + /** + * Method definitions for class CImplicitPortIterator + */ + + /** + * CImplicitPortIterator::GetCurrent - Returns the current element + * @return The current element + */ + PImplicitPort CImplicitPortIterator::GetCurrent() + { + Lib3MFHandle hPort = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitportiterator_getcurrent(m_pHandle, &hPort)); + + if (!hPort) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPort))); + } + + /** + * Method definitions for class CImplicitNode + */ + + /** + * CImplicitNode::GetIdentifier - Retrieves the identifier of the node + * @return the identifier + */ + std::string CImplicitNode::GetIdentifier() + { + Lib3MF_uint32 bytesNeededIdentifier = 0; + Lib3MF_uint32 bytesWrittenIdentifier = 0; + CheckError(lib3mf_implicitnode_getidentifier(m_pHandle, 0, &bytesNeededIdentifier, nullptr)); + std::vector bufferIdentifier(bytesNeededIdentifier); + CheckError(lib3mf_implicitnode_getidentifier(m_pHandle, bytesNeededIdentifier, &bytesWrittenIdentifier, &bufferIdentifier[0])); + + return std::string(&bufferIdentifier[0]); + } + + /** + * CImplicitNode::SetIdentifier - Sets the identifier of the node + * @param[in] sIdentifier - the identifier + */ + void CImplicitNode::SetIdentifier(const std::string & sIdentifier) + { + CheckError(lib3mf_implicitnode_setidentifier(m_pHandle, sIdentifier.c_str())); + } + + /** + * CImplicitNode::GetDisplayName - Retrieves the display name of the node + * @return the display name + */ + std::string CImplicitNode::GetDisplayName() + { + Lib3MF_uint32 bytesNeededDisplayName = 0; + Lib3MF_uint32 bytesWrittenDisplayName = 0; + CheckError(lib3mf_implicitnode_getdisplayname(m_pHandle, 0, &bytesNeededDisplayName, nullptr)); + std::vector bufferDisplayName(bytesNeededDisplayName); + CheckError(lib3mf_implicitnode_getdisplayname(m_pHandle, bytesNeededDisplayName, &bytesWrittenDisplayName, &bufferDisplayName[0])); + + return std::string(&bufferDisplayName[0]); + } + + /** + * CImplicitNode::SetDisplayName - Sets the display name of the node + * @param[in] sDisplayName - the display name + */ + void CImplicitNode::SetDisplayName(const std::string & sDisplayName) + { + CheckError(lib3mf_implicitnode_setdisplayname(m_pHandle, sDisplayName.c_str())); + } + + /** + * CImplicitNode::GetTag - Retrieves the tag of the node + * @return the tag + */ + std::string CImplicitNode::GetTag() + { + Lib3MF_uint32 bytesNeededTag = 0; + Lib3MF_uint32 bytesWrittenTag = 0; + CheckError(lib3mf_implicitnode_gettag(m_pHandle, 0, &bytesNeededTag, nullptr)); + std::vector bufferTag(bytesNeededTag); + CheckError(lib3mf_implicitnode_gettag(m_pHandle, bytesNeededTag, &bytesWrittenTag, &bufferTag[0])); + + return std::string(&bufferTag[0]); + } + + /** + * CImplicitNode::SetTag - Sets the tag of the node + * @param[in] sTag - the tag + */ + void CImplicitNode::SetTag(const std::string & sTag) + { + CheckError(lib3mf_implicitnode_settag(m_pHandle, sTag.c_str())); + } + + /** + * CImplicitNode::GetNodeType - Retrieves the type of the node + * @return the type of the node + */ + eImplicitNodeType CImplicitNode::GetNodeType() + { + eImplicitNodeType resultType = (eImplicitNodeType) 0; + CheckError(lib3mf_implicitnode_getnodetype(m_pHandle, &resultType)); + + return resultType; + } + + /** + * CImplicitNode::AddInput - Add an input + * @param[in] sIdentifier - the identifier of the input + * @param[in] sDisplayName - the display name of the input + * @return + */ + PImplicitPort CImplicitNode::AddInput(const std::string & sIdentifier, const std::string & sDisplayName) + { + Lib3MFHandle hPort = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitnode_addinput(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), &hPort)); + + if (!hPort) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPort))); + } + + /** + * CImplicitNode::GetInputs - Retrieves the inputs + * @return the iterator for the inputs + */ + PImplicitPortIterator CImplicitNode::GetInputs() + { + Lib3MFHandle hIterator = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitnode_getinputs(m_pHandle, &hIterator)); + + if (!hIterator) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hIterator))); + } + + /** + * CImplicitNode::AddOutput - Add an output + * @param[in] sIdentifier - the identifier of the output + * @param[in] sDisplayName - the display name of the output + * @return + */ + PImplicitPort CImplicitNode::AddOutput(const std::string & sIdentifier, const std::string & sDisplayName) + { + Lib3MFHandle hPort = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitnode_addoutput(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), &hPort)); + + if (!hPort) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPort))); + } + + /** + * CImplicitNode::GetOutputs - Retrieves the outputs + * @return the iterator the outputs + */ + PImplicitPortIterator CImplicitNode::GetOutputs() + { + Lib3MFHandle hIterator = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitnode_getoutputs(m_pHandle, &hIterator)); + + if (!hIterator) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hIterator))); + } + + /** + * CImplicitNode::FindInput - Retrieves an input + * @param[in] sIdentifier - the identifier of the input + * @return the input port + */ + PImplicitPort CImplicitNode::FindInput(const std::string & sIdentifier) + { + Lib3MFHandle hInput = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitnode_findinput(m_pHandle, sIdentifier.c_str(), &hInput)); + + if (hInput) { + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hInput))); + } else { + return nullptr; + } + } + + /** + * CImplicitNode::FindOutput - Retrieves an output + * @param[in] sIdentifier - the identifier of the output + * @return the output port + */ + PImplicitPort CImplicitNode::FindOutput(const std::string & sIdentifier) + { + Lib3MFHandle hOutput = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitnode_findoutput(m_pHandle, sIdentifier.c_str(), &hOutput)); + + if (hOutput) { + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hOutput))); + } else { + return nullptr; + } + } + + /** + * CImplicitNode::AreTypesValid - Checks if the types of the input and output ports are valid for the node type + * @return true, if the types are valid + */ + bool CImplicitNode::AreTypesValid() + { + bool resultValid = 0; + CheckError(lib3mf_implicitnode_aretypesvalid(m_pHandle, &resultValid)); + + return resultValid; + } + + /** + * Method definitions for class COneInputNode + */ + + /** + * COneInputNode::GetInputA - Retrieves the input + * @return the input + */ + PImplicitPort COneInputNode::GetInputA() + { + Lib3MFHandle hInput = (Lib3MFHandle)nullptr; + CheckError(lib3mf_oneinputnode_getinputa(m_pHandle, &hInput)); + + if (!hInput) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hInput))); + } + + /** + * COneInputNode::GetOutputResult - Retrieves the output + * @return the output + */ + PImplicitPort COneInputNode::GetOutputResult() + { + Lib3MFHandle hResult = (Lib3MFHandle)nullptr; + CheckError(lib3mf_oneinputnode_getoutputresult(m_pHandle, &hResult)); + + if (!hResult) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResult))); + } + + /** + * Method definitions for class CSinNode + */ + + /** + * Method definitions for class CCosNode + */ + + /** + * Method definitions for class CTanNode + */ + + /** + * Method definitions for class CArcSinNode + */ + + /** + * Method definitions for class CArcCosNode + */ + + /** + * Method definitions for class CArcTanNode + */ + + /** + * Method definitions for class CSinhNode + */ + + /** + * Method definitions for class CCoshNode + */ + + /** + * Method definitions for class CTanhNode + */ + + /** + * Method definitions for class CRoundNode + */ + + /** + * Method definitions for class CCeilNode + */ + + /** + * Method definitions for class CFloorNode + */ + + /** + * Method definitions for class CSignNode + */ + + /** + * Method definitions for class CFractNode + */ + + /** + * Method definitions for class CAbsNode + */ + + /** + * Method definitions for class CExpNode + */ + + /** + * Method definitions for class CLogNode + */ + + /** + * Method definitions for class CLog2Node + */ + + /** + * Method definitions for class CLog10Node + */ + + /** + * Method definitions for class CLengthNode + */ + + /** + * Method definitions for class CTransposeNode + */ + + /** + * Method definitions for class CInverseNode + */ + + /** + * Method definitions for class CSqrtNode + */ + + /** + * Method definitions for class CResourceIdNode + */ + + /** + * CResourceIdNode::SetResource - Sets the Resource that the resourceid attribute of the node will point to + * @param[in] pResource - the resource + */ + void CResourceIdNode::SetResource(classParam pResource) + { + Lib3MFHandle hResource = pResource.GetHandle(); + CheckError(lib3mf_resourceidnode_setresource(m_pHandle, hResource)); + } + + /** + * CResourceIdNode::GetResource - Retrieves the resource of the node + * @return the resource + */ + PResource CResourceIdNode::GetResource() + { + Lib3MFHandle hResource = (Lib3MFHandle)nullptr; + CheckError(lib3mf_resourceidnode_getresource(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * CResourceIdNode::GetOutputValue - Retrieves the output + * @return the output + */ + PImplicitPort CResourceIdNode::GetOutputValue() + { + Lib3MFHandle hValue = (Lib3MFHandle)nullptr; + CheckError(lib3mf_resourceidnode_getoutputvalue(m_pHandle, &hValue)); + + if (!hValue) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hValue))); + } + + /** + * Method definitions for class CTwoInputNode + */ + + /** + * CTwoInputNode::GetInputB - Retrieves the second input + * @return the second input + */ + PImplicitPort CTwoInputNode::GetInputB() + { + Lib3MFHandle hB = (Lib3MFHandle)nullptr; + CheckError(lib3mf_twoinputnode_getinputb(m_pHandle, &hB)); + + if (!hB) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hB))); + } + + /** + * Method definitions for class CAdditionNode + */ + + /** + * Method definitions for class CSubtractionNode + */ + + /** + * Method definitions for class CMultiplicationNode + */ + + /** + * Method definitions for class CDivisionNode + */ + + /** + * Method definitions for class CDotNode + */ + + /** + * Method definitions for class CCrossNode + */ + + /** + * Method definitions for class CArcTan2Node + */ + + /** + * Method definitions for class CMatVecMultiplicationNode + */ + + /** + * Method definitions for class CMinNode + */ + + /** + * Method definitions for class CMaxNode + */ + + /** + * Method definitions for class CFmodNode + */ + + /** + * Method definitions for class CModNode + */ + + /** + * Method definitions for class CPowNode + */ + + /** + * Method definitions for class CSelectNode + */ + + /** + * CSelectNode::GetInputB - Retrieves the second input + * @return the second input + */ + PImplicitPort CSelectNode::GetInputB() + { + Lib3MFHandle hB = (Lib3MFHandle)nullptr; + CheckError(lib3mf_selectnode_getinputb(m_pHandle, &hB)); + + if (!hB) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hB))); + } + + /** + * CSelectNode::GetInputC - Retrieves the third input + * @return the third input + */ + PImplicitPort CSelectNode::GetInputC() + { + Lib3MFHandle hC = (Lib3MFHandle)nullptr; + CheckError(lib3mf_selectnode_getinputc(m_pHandle, &hC)); + + if (!hC) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hC))); + } + + /** + * CSelectNode::GetInputD - Retrieves the fourth input + * @return the fourth input + */ + PImplicitPort CSelectNode::GetInputD() + { + Lib3MFHandle hD = (Lib3MFHandle)nullptr; + CheckError(lib3mf_selectnode_getinputd(m_pHandle, &hD)); + + if (!hD) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hD))); + } + + /** + * Method definitions for class CClampNode + */ + + /** + * CClampNode::GetInputMin - Retrieves the input for the lower limit + * @return the input for the lower limit + */ + PImplicitPort CClampNode::GetInputMin() + { + Lib3MFHandle hMin = (Lib3MFHandle)nullptr; + CheckError(lib3mf_clampnode_getinputmin(m_pHandle, &hMin)); + + if (!hMin) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMin))); + } + + /** + * CClampNode::GetInputMax - Retrieves the input for the upper limit + * @return the input for the upper limit + */ + PImplicitPort CClampNode::GetInputMax() + { + Lib3MFHandle hMax = (Lib3MFHandle)nullptr; + CheckError(lib3mf_clampnode_getinputmax(m_pHandle, &hMax)); + + if (!hMax) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMax))); + } + + /** + * Method definitions for class CComposeVectorNode + */ + + /** + * CComposeVectorNode::GetInputX - Retrieves the input for the x component + * @return the input for the x component + */ + PImplicitPort CComposeVectorNode::GetInputX() + { + Lib3MFHandle hX = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composevectornode_getinputx(m_pHandle, &hX)); + + if (!hX) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hX))); + } + + /** + * CComposeVectorNode::GetInputY - Retrieves the input for the y component + * @return the input for the y component + */ + PImplicitPort CComposeVectorNode::GetInputY() + { + Lib3MFHandle hY = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composevectornode_getinputy(m_pHandle, &hY)); + + if (!hY) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hY))); + } + + /** + * CComposeVectorNode::GetInputZ - Retrieves the input for the z component + * @return the input for the z component + */ + PImplicitPort CComposeVectorNode::GetInputZ() + { + Lib3MFHandle hZ = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composevectornode_getinputz(m_pHandle, &hZ)); + + if (!hZ) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hZ))); + } + + /** + * CComposeVectorNode::GetOutputResult - Retrieves the output + * @return the output + */ + PImplicitPort CComposeVectorNode::GetOutputResult() + { + Lib3MFHandle hResult = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composevectornode_getoutputresult(m_pHandle, &hResult)); + + if (!hResult) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResult))); + } + + /** + * Method definitions for class CVectorFromScalarNode + */ + + /** + * Method definitions for class CDecomposeVectorNode + */ + + /** + * CDecomposeVectorNode::GetInputA - Retrieves the input + * @return the input port for the vector to decompose + */ + PImplicitPort CDecomposeVectorNode::GetInputA() + { + Lib3MFHandle hA = (Lib3MFHandle)nullptr; + CheckError(lib3mf_decomposevectornode_getinputa(m_pHandle, &hA)); + + if (!hA) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hA))); + } + + /** + * CDecomposeVectorNode::GetOutputX - Retrieves the output for the x component + * @return the output for the x component + */ + PImplicitPort CDecomposeVectorNode::GetOutputX() + { + Lib3MFHandle hX = (Lib3MFHandle)nullptr; + CheckError(lib3mf_decomposevectornode_getoutputx(m_pHandle, &hX)); + + if (!hX) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hX))); + } + + /** + * CDecomposeVectorNode::GetOutputY - Retrieves the output for the y component + * @return the output for the y component + */ + PImplicitPort CDecomposeVectorNode::GetOutputY() + { + Lib3MFHandle hY = (Lib3MFHandle)nullptr; + CheckError(lib3mf_decomposevectornode_getoutputy(m_pHandle, &hY)); + + if (!hY) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hY))); + } + + /** + * CDecomposeVectorNode::GetOutputZ - Retrieves the output for the z component + * @return the output for the z component + */ + PImplicitPort CDecomposeVectorNode::GetOutputZ() + { + Lib3MFHandle hZ = (Lib3MFHandle)nullptr; + CheckError(lib3mf_decomposevectornode_getoutputz(m_pHandle, &hZ)); + + if (!hZ) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hZ))); + } + + /** + * Method definitions for class CComposeMatrixNode + */ + + /** + * CComposeMatrixNode::GetInputM00 - Retrieves the input for the element 0 0 + * @return the input for the m00 element + */ + PImplicitPort CComposeMatrixNode::GetInputM00() + { + Lib3MFHandle hM00 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composematrixnode_getinputm00(m_pHandle, &hM00)); + + if (!hM00) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hM00))); + } + + /** + * CComposeMatrixNode::GetInputM01 - Retrieves the input for the element 0 1 + * @return the input for the m01 element + */ + PImplicitPort CComposeMatrixNode::GetInputM01() + { + Lib3MFHandle hM01 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composematrixnode_getinputm01(m_pHandle, &hM01)); + + if (!hM01) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hM01))); + } + + /** + * CComposeMatrixNode::GetInputM02 - Retrieves the input for the element 0 2 + * @return the input for the m02 element + */ + PImplicitPort CComposeMatrixNode::GetInputM02() + { + Lib3MFHandle hM02 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composematrixnode_getinputm02(m_pHandle, &hM02)); + + if (!hM02) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hM02))); + } + + /** + * CComposeMatrixNode::GetInputM03 - Retrieves the input for the element 0 3 + * @return the input for the m03 element + */ + PImplicitPort CComposeMatrixNode::GetInputM03() + { + Lib3MFHandle hM03 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composematrixnode_getinputm03(m_pHandle, &hM03)); + + if (!hM03) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hM03))); + } + + /** + * CComposeMatrixNode::GetInputM10 - Retrieves the input for the element 1 0 + * @return the input for the m10 element + */ + PImplicitPort CComposeMatrixNode::GetInputM10() + { + Lib3MFHandle hM10 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composematrixnode_getinputm10(m_pHandle, &hM10)); + + if (!hM10) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hM10))); + } + + /** + * CComposeMatrixNode::GetInputM11 - Retrieves the input for the element 1 1 + * @return the input for the m11 element + */ + PImplicitPort CComposeMatrixNode::GetInputM11() + { + Lib3MFHandle hM11 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composematrixnode_getinputm11(m_pHandle, &hM11)); + + if (!hM11) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hM11))); + } + + /** + * CComposeMatrixNode::GetInputM12 - Retrieves the input for the element 1 2 + * @return the input for the m12 element + */ + PImplicitPort CComposeMatrixNode::GetInputM12() + { + Lib3MFHandle hM12 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composematrixnode_getinputm12(m_pHandle, &hM12)); + + if (!hM12) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hM12))); + } + + /** + * CComposeMatrixNode::GetInputM13 - Retrieves the input for the element 1 3 + * @return the input for the m13 element + */ + PImplicitPort CComposeMatrixNode::GetInputM13() + { + Lib3MFHandle hM13 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composematrixnode_getinputm13(m_pHandle, &hM13)); + + if (!hM13) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hM13))); + } + + /** + * CComposeMatrixNode::GetInputM20 - Retrieves the input for the element 2 0 + * @return the input for the m20 element + */ + PImplicitPort CComposeMatrixNode::GetInputM20() + { + Lib3MFHandle hM20 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composematrixnode_getinputm20(m_pHandle, &hM20)); + + if (!hM20) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hM20))); + } + + /** + * CComposeMatrixNode::GetInputM21 - Retrieves the input for the element 2 1 + * @return + */ + PImplicitPort CComposeMatrixNode::GetInputM21() + { + Lib3MFHandle hM21 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composematrixnode_getinputm21(m_pHandle, &hM21)); + + if (!hM21) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hM21))); + } + + /** + * CComposeMatrixNode::GetInputM22 - Retrieves the input for the element 2 2 + * @return the input for the m22 element + */ + PImplicitPort CComposeMatrixNode::GetInputM22() + { + Lib3MFHandle hM22 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composematrixnode_getinputm22(m_pHandle, &hM22)); + + if (!hM22) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hM22))); + } + + /** + * CComposeMatrixNode::GetInputM23 - Retrieves the input for the element 2 3 + * @return the input for the m23 element + */ + PImplicitPort CComposeMatrixNode::GetInputM23() + { + Lib3MFHandle hM23 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composematrixnode_getinputm23(m_pHandle, &hM23)); + + if (!hM23) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hM23))); + } + + /** + * CComposeMatrixNode::GetInputM30 - Retrieves the input for the element 3 0 + * @return the input for the m30 element + */ + PImplicitPort CComposeMatrixNode::GetInputM30() + { + Lib3MFHandle hM30 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composematrixnode_getinputm30(m_pHandle, &hM30)); + + if (!hM30) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hM30))); + } + + /** + * CComposeMatrixNode::GetInputM31 - Retrieves the input for the element 3 1 + * @return the input for the m31 element + */ + PImplicitPort CComposeMatrixNode::GetInputM31() + { + Lib3MFHandle hM31 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composematrixnode_getinputm31(m_pHandle, &hM31)); + + if (!hM31) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hM31))); + } + + /** + * CComposeMatrixNode::GetInputM32 - Retrieves the input for the element 3 2 + * @return the input for the m32 element + */ + PImplicitPort CComposeMatrixNode::GetInputM32() + { + Lib3MFHandle hM32 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composematrixnode_getinputm32(m_pHandle, &hM32)); + + if (!hM32) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hM32))); + } + + /** + * CComposeMatrixNode::GetInputM33 - Retrieves the input for the element 3 3 + * @return the input for the m33 element + */ + PImplicitPort CComposeMatrixNode::GetInputM33() + { + Lib3MFHandle hM33 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composematrixnode_getinputm33(m_pHandle, &hM33)); + + if (!hM33) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hM33))); + } + + /** + * CComposeMatrixNode::GetOutputResult - Retrieves the output + * @return the output + */ + PImplicitPort CComposeMatrixNode::GetOutputResult() + { + Lib3MFHandle hResult = (Lib3MFHandle)nullptr; + CheckError(lib3mf_composematrixnode_getoutputresult(m_pHandle, &hResult)); + + if (!hResult) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResult))); + } + + /** + * Method definitions for class CMatrixFromRowsNode + */ + + /** + * CMatrixFromRowsNode::GetInputA - Retrieves the input for the first row + * @return the input for the first row + */ + PImplicitPort CMatrixFromRowsNode::GetInputA() + { + Lib3MFHandle hRow0 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_matrixfromrowsnode_getinputa(m_pHandle, &hRow0)); + + if (!hRow0) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hRow0))); + } + + /** + * CMatrixFromRowsNode::GetInputB - Retrieves the input for the second row + * @return the input for the second row + */ + PImplicitPort CMatrixFromRowsNode::GetInputB() + { + Lib3MFHandle hRow1 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_matrixfromrowsnode_getinputb(m_pHandle, &hRow1)); + + if (!hRow1) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hRow1))); + } + + /** + * CMatrixFromRowsNode::GetInputC - Retrieves the input for the third row + * @return the input for the third row + */ + PImplicitPort CMatrixFromRowsNode::GetInputC() + { + Lib3MFHandle hRow2 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_matrixfromrowsnode_getinputc(m_pHandle, &hRow2)); + + if (!hRow2) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hRow2))); + } + + /** + * CMatrixFromRowsNode::GetInputD - Retrieves the input for the fourth row + * @return the input for the fourth row + */ + PImplicitPort CMatrixFromRowsNode::GetInputD() + { + Lib3MFHandle hRow3 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_matrixfromrowsnode_getinputd(m_pHandle, &hRow3)); + + if (!hRow3) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hRow3))); + } + + /** + * CMatrixFromRowsNode::GetOutputResult - Retrieves the output + * @return the output + */ + PImplicitPort CMatrixFromRowsNode::GetOutputResult() + { + Lib3MFHandle hResult = (Lib3MFHandle)nullptr; + CheckError(lib3mf_matrixfromrowsnode_getoutputresult(m_pHandle, &hResult)); + + if (!hResult) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResult))); + } + + /** + * Method definitions for class CMatrixFromColumnsNode + */ + + /** + * CMatrixFromColumnsNode::GetInputA - Retrieves the input for the first column + * @return the input for the first column + */ + PImplicitPort CMatrixFromColumnsNode::GetInputA() + { + Lib3MFHandle hColumn0 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_matrixfromcolumnsnode_getinputa(m_pHandle, &hColumn0)); + + if (!hColumn0) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hColumn0))); + } + + /** + * CMatrixFromColumnsNode::GetInputB - Retrieves the input for the second column + * @return the input for the second column + */ + PImplicitPort CMatrixFromColumnsNode::GetInputB() + { + Lib3MFHandle hColumn1 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_matrixfromcolumnsnode_getinputb(m_pHandle, &hColumn1)); + + if (!hColumn1) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hColumn1))); + } + + /** + * CMatrixFromColumnsNode::GetInputC - Retrieves the input for the third column + * @return the input for the third column + */ + PImplicitPort CMatrixFromColumnsNode::GetInputC() + { + Lib3MFHandle hColumn2 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_matrixfromcolumnsnode_getinputc(m_pHandle, &hColumn2)); + + if (!hColumn2) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hColumn2))); + } + + /** + * CMatrixFromColumnsNode::GetInputD - Retrieves the input for the fourth column + * @return the input for the fourth column + */ + PImplicitPort CMatrixFromColumnsNode::GetInputD() + { + Lib3MFHandle hColumn3 = (Lib3MFHandle)nullptr; + CheckError(lib3mf_matrixfromcolumnsnode_getinputd(m_pHandle, &hColumn3)); + + if (!hColumn3) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hColumn3))); + } + + /** + * CMatrixFromColumnsNode::GetOutputResult - Retrieves the output + * @return the output + */ + PImplicitPort CMatrixFromColumnsNode::GetOutputResult() + { + Lib3MFHandle hResult = (Lib3MFHandle)nullptr; + CheckError(lib3mf_matrixfromcolumnsnode_getoutputresult(m_pHandle, &hResult)); + + if (!hResult) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResult))); + } + + /** + * Method definitions for class CConstantNode + */ + + /** + * CConstantNode::SetConstant - Sets the constant value of the node + * @param[in] dValue - the value + */ + void CConstantNode::SetConstant(const Lib3MF_double dValue) + { + CheckError(lib3mf_constantnode_setconstant(m_pHandle, dValue)); + } + + /** + * CConstantNode::GetConstant - Retrieves the constant value of the node + * @return the value + */ + Lib3MF_double CConstantNode::GetConstant() + { + Lib3MF_double resultValue = 0; + CheckError(lib3mf_constantnode_getconstant(m_pHandle, &resultValue)); + + return resultValue; + } + + /** + * CConstantNode::GetOutputValue - Retrieves the output + * @return the output + */ + PImplicitPort CConstantNode::GetOutputValue() + { + Lib3MFHandle hValue = (Lib3MFHandle)nullptr; + CheckError(lib3mf_constantnode_getoutputvalue(m_pHandle, &hValue)); + + if (!hValue) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hValue))); + } + + /** + * Method definitions for class CConstVecNode + */ + + /** + * CConstVecNode::SetVector - Sets the vector value of the node + * @param[in] Value - the value + */ + void CConstVecNode::SetVector(const sVector & Value) + { + CheckError(lib3mf_constvecnode_setvector(m_pHandle, &Value)); + } + + /** + * CConstVecNode::GetVector - Retrieves the vector value of the node + * @return the value + */ + sVector CConstVecNode::GetVector() + { + sVector resultValue; + CheckError(lib3mf_constvecnode_getvector(m_pHandle, &resultValue)); + + return resultValue; + } + + /** + * CConstVecNode::GetOutputVector - Retrieves the output + * @return the output + */ + PImplicitPort CConstVecNode::GetOutputVector() + { + Lib3MFHandle hVector = (Lib3MFHandle)nullptr; + CheckError(lib3mf_constvecnode_getoutputvector(m_pHandle, &hVector)); + + if (!hVector) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hVector))); + } + + /** + * Method definitions for class CConstMatNode + */ + + /** + * CConstMatNode::SetMatrix - Sets the matrix value of the node + * @param[in] Value - the value + */ + void CConstMatNode::SetMatrix(const sMatrix4x4 & Value) + { + CheckError(lib3mf_constmatnode_setmatrix(m_pHandle, &Value)); + } + + /** + * CConstMatNode::GetMatrix - Retrieves the matrix value of the node + * @return the matrix + */ + sMatrix4x4 CConstMatNode::GetMatrix() + { + sMatrix4x4 resultValue; + CheckError(lib3mf_constmatnode_getmatrix(m_pHandle, &resultValue)); + + return resultValue; + } + + /** + * CConstMatNode::GetOutputMatrix - Retrieves the output + * @return the output + */ + PImplicitPort CConstMatNode::GetOutputMatrix() + { + Lib3MFHandle hMatrix = (Lib3MFHandle)nullptr; + CheckError(lib3mf_constmatnode_getoutputmatrix(m_pHandle, &hMatrix)); + + if (!hMatrix) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMatrix))); + } + + /** + * Method definitions for class CMeshNode + */ + + /** + * CMeshNode::GetInputMesh - Retrieves the input for the model resource id of the mesh + * @return the input port for the model resource id of the mesh + */ + PImplicitPort CMeshNode::GetInputMesh() + { + Lib3MFHandle hMesh = (Lib3MFHandle)nullptr; + CheckError(lib3mf_meshnode_getinputmesh(m_pHandle, &hMesh)); + + if (!hMesh) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMesh))); + } + + /** + * CMeshNode::GetInputPos - Retrieves the input for the position + * @return the input port for the position + */ + PImplicitPort CMeshNode::GetInputPos() + { + Lib3MFHandle hPos = (Lib3MFHandle)nullptr; + CheckError(lib3mf_meshnode_getinputpos(m_pHandle, &hPos)); + + if (!hPos) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPos))); + } + + /** + * CMeshNode::GetOutputDistance - Retrieves the output + * @return the output port for the signed distance to the mesh + */ + PImplicitPort CMeshNode::GetOutputDistance() + { + Lib3MFHandle hDistance = (Lib3MFHandle)nullptr; + CheckError(lib3mf_meshnode_getoutputdistance(m_pHandle, &hDistance)); + + if (!hDistance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hDistance))); + } + + /** + * Method definitions for class CUnsignedMeshNode + */ + + /** + * CUnsignedMeshNode::GetInputMesh - Retrieves the input for the model resource id of the mesh + * @return the input port for the model resource id of the mesh + */ + PImplicitPort CUnsignedMeshNode::GetInputMesh() + { + Lib3MFHandle hMesh = (Lib3MFHandle)nullptr; + CheckError(lib3mf_unsignedmeshnode_getinputmesh(m_pHandle, &hMesh)); + + if (!hMesh) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMesh))); + } + + /** + * CUnsignedMeshNode::GetInputPos - Retrieves the input for the position + * @return the input port for the position + */ + PImplicitPort CUnsignedMeshNode::GetInputPos() + { + Lib3MFHandle hPos = (Lib3MFHandle)nullptr; + CheckError(lib3mf_unsignedmeshnode_getinputpos(m_pHandle, &hPos)); + + if (!hPos) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPos))); + } + + /** + * CUnsignedMeshNode::GetOutputDistance - Retrieves the output + * @return the output port for the unsigned distance to the mesh + */ + PImplicitPort CUnsignedMeshNode::GetOutputDistance() + { + Lib3MFHandle hDistance = (Lib3MFHandle)nullptr; + CheckError(lib3mf_unsignedmeshnode_getoutputdistance(m_pHandle, &hDistance)); + + if (!hDistance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hDistance))); + } + + /** + * Method definitions for class CBeamLatticeNode + */ + + /** + * CBeamLatticeNode::GetInputBeamLattice - Retrieves the input for the model resource id of the beam lattice + * @return the input port for the model resource id of the beam lattice (mesh with beamlattice extension) + */ + PImplicitPort CBeamLatticeNode::GetInputBeamLattice() + { + Lib3MFHandle hBeamLattice = (Lib3MFHandle)nullptr; + CheckError(lib3mf_beamlatticenode_getinputbeamlattice(m_pHandle, &hBeamLattice)); + + if (!hBeamLattice) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBeamLattice))); + } + + /** + * CBeamLatticeNode::GetInputPos - Retrieves the input for the position + * @return the input port for the position + */ + PImplicitPort CBeamLatticeNode::GetInputPos() + { + Lib3MFHandle hPos = (Lib3MFHandle)nullptr; + CheckError(lib3mf_beamlatticenode_getinputpos(m_pHandle, &hPos)); + + if (!hPos) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPos))); + } + + /** + * CBeamLatticeNode::GetOutputDistance - Retrieves the output + * @return the output port for the signed distance to the beam lattice + */ + PImplicitPort CBeamLatticeNode::GetOutputDistance() + { + Lib3MFHandle hDistance = (Lib3MFHandle)nullptr; + CheckError(lib3mf_beamlatticenode_getoutputdistance(m_pHandle, &hDistance)); + + if (!hDistance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hDistance))); + } + + /** + * CBeamLatticeNode::SetAccurateRange - Sets the accurate range for distance computation + * @param[in] dAccurateRange - the accurate range in model units + */ + void CBeamLatticeNode::SetAccurateRange(const Lib3MF_double dAccurateRange) + { + CheckError(lib3mf_beamlatticenode_setaccuraterange(m_pHandle, dAccurateRange)); + } + + /** + * CBeamLatticeNode::GetAccurateRange - Retrieves the accurate range for distance computation + * @return the accurate range in model units + */ + Lib3MF_double CBeamLatticeNode::GetAccurateRange() + { + Lib3MF_double resultAccurateRange = 0; + CheckError(lib3mf_beamlatticenode_getaccuraterange(m_pHandle, &resultAccurateRange)); + + return resultAccurateRange; + } + + /** + * Method definitions for class CFunctionGradientNode + */ + + /** + * CFunctionGradientNode::GetInputFunctionID - Retrieves the input for the function id + * @return the input port for the function + */ + PImplicitPort CFunctionGradientNode::GetInputFunctionID() + { + Lib3MFHandle hFunction = (Lib3MFHandle)nullptr; + CheckError(lib3mf_functiongradientnode_getinputfunctionid(m_pHandle, &hFunction)); + + if (!hFunction) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hFunction))); + } + + /** + * CFunctionGradientNode::GetInputPos - Retrieves the input for the position + * @return the input port for the position + */ + PImplicitPort CFunctionGradientNode::GetInputPos() + { + Lib3MFHandle hPos = (Lib3MFHandle)nullptr; + CheckError(lib3mf_functiongradientnode_getinputpos(m_pHandle, &hPos)); + + if (!hPos) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPos))); + } + + /** + * CFunctionGradientNode::GetInputStep - Retrieves the input for the finite difference step + * @return the input port for the finite difference step + */ + PImplicitPort CFunctionGradientNode::GetInputStep() + { + Lib3MFHandle hStep = (Lib3MFHandle)nullptr; + CheckError(lib3mf_functiongradientnode_getinputstep(m_pHandle, &hStep)); + + if (!hStep) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hStep))); + } + + /** + * CFunctionGradientNode::SetScalarOutputName - Sets the name of the referenced scalar output + * @param[in] sScalarOutputName - the name of the scalar output of the referenced function + */ + void CFunctionGradientNode::SetScalarOutputName(const std::string & sScalarOutputName) + { + CheckError(lib3mf_functiongradientnode_setscalaroutputname(m_pHandle, sScalarOutputName.c_str())); + } + + /** + * CFunctionGradientNode::GetScalarOutputName - Retrieves the name of the referenced scalar output + * @return the name of the scalar output of the referenced function + */ + std::string CFunctionGradientNode::GetScalarOutputName() + { + Lib3MF_uint32 bytesNeededScalarOutputName = 0; + Lib3MF_uint32 bytesWrittenScalarOutputName = 0; + CheckError(lib3mf_functiongradientnode_getscalaroutputname(m_pHandle, 0, &bytesNeededScalarOutputName, nullptr)); + std::vector bufferScalarOutputName(bytesNeededScalarOutputName); + CheckError(lib3mf_functiongradientnode_getscalaroutputname(m_pHandle, bytesNeededScalarOutputName, &bytesWrittenScalarOutputName, &bufferScalarOutputName[0])); + + return std::string(&bufferScalarOutputName[0]); + } + + /** + * CFunctionGradientNode::SetVectorInputName - Sets the name of the referenced vector input + * @param[in] sVectorInputName - the name of the vector input (float3) of the referenced function + */ + void CFunctionGradientNode::SetVectorInputName(const std::string & sVectorInputName) + { + CheckError(lib3mf_functiongradientnode_setvectorinputname(m_pHandle, sVectorInputName.c_str())); + } + + /** + * CFunctionGradientNode::GetVectorInputName - Retrieves the name of the referenced vector input + * @return the name of the vector input (float3) of the referenced function + */ + std::string CFunctionGradientNode::GetVectorInputName() + { + Lib3MF_uint32 bytesNeededVectorInputName = 0; + Lib3MF_uint32 bytesWrittenVectorInputName = 0; + CheckError(lib3mf_functiongradientnode_getvectorinputname(m_pHandle, 0, &bytesNeededVectorInputName, nullptr)); + std::vector bufferVectorInputName(bytesNeededVectorInputName); + CheckError(lib3mf_functiongradientnode_getvectorinputname(m_pHandle, bytesNeededVectorInputName, &bytesWrittenVectorInputName, &bufferVectorInputName[0])); + + return std::string(&bufferVectorInputName[0]); + } + + /** + * CFunctionGradientNode::GetOutputNormalizedGradient - Retrieves the normalized gradient output + * @return the output port for the normalized gradient + */ + PImplicitPort CFunctionGradientNode::GetOutputNormalizedGradient() + { + Lib3MFHandle hNormalizedGradient = (Lib3MFHandle)nullptr; + CheckError(lib3mf_functiongradientnode_getoutputnormalizedgradient(m_pHandle, &hNormalizedGradient)); + + if (!hNormalizedGradient) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNormalizedGradient))); + } + + /** + * CFunctionGradientNode::GetOutputGradient - Retrieves the raw gradient output + * @return the output port for the raw gradient + */ + PImplicitPort CFunctionGradientNode::GetOutputGradient() + { + Lib3MFHandle hGradient = (Lib3MFHandle)nullptr; + CheckError(lib3mf_functiongradientnode_getoutputgradient(m_pHandle, &hGradient)); + + if (!hGradient) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hGradient))); + } + + /** + * CFunctionGradientNode::GetOutputMagnitude - Retrieves the gradient magnitude output + * @return the output port for the gradient magnitude + */ + PImplicitPort CFunctionGradientNode::GetOutputMagnitude() + { + Lib3MFHandle hMagnitude = (Lib3MFHandle)nullptr; + CheckError(lib3mf_functiongradientnode_getoutputmagnitude(m_pHandle, &hMagnitude)); + + if (!hMagnitude) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMagnitude))); + } + + /** + * Method definitions for class CNormalizeDistanceNode + */ + + /** + * CNormalizeDistanceNode::GetInputFunctionID - Retrieves the input for the function id + * @return the input port for the function + */ + PImplicitPort CNormalizeDistanceNode::GetInputFunctionID() + { + Lib3MFHandle hFunction = (Lib3MFHandle)nullptr; + CheckError(lib3mf_normalizedistancenode_getinputfunctionid(m_pHandle, &hFunction)); + + if (!hFunction) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hFunction))); + } + + /** + * CNormalizeDistanceNode::GetInputPos - Retrieves the input for the position + * @return the input port for the position (vector) + */ + PImplicitPort CNormalizeDistanceNode::GetInputPos() + { + Lib3MFHandle hPos = (Lib3MFHandle)nullptr; + CheckError(lib3mf_normalizedistancenode_getinputpos(m_pHandle, &hPos)); + + if (!hPos) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPos))); + } + + /** + * CNormalizeDistanceNode::GetInputStep - Retrieves the input for the finite difference step + * @return the input port for the finite difference step + */ + PImplicitPort CNormalizeDistanceNode::GetInputStep() + { + Lib3MFHandle hStep = (Lib3MFHandle)nullptr; + CheckError(lib3mf_normalizedistancenode_getinputstep(m_pHandle, &hStep)); + + if (!hStep) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hStep))); + } + + /** + * CNormalizeDistanceNode::SetScalarOutputName - Sets the name of the referenced scalar output + * @param[in] sScalarOutputName - the name of the scalar output of the referenced function + */ + void CNormalizeDistanceNode::SetScalarOutputName(const std::string & sScalarOutputName) + { + CheckError(lib3mf_normalizedistancenode_setscalaroutputname(m_pHandle, sScalarOutputName.c_str())); + } + + /** + * CNormalizeDistanceNode::GetScalarOutputName - Retrieves the name of the referenced scalar output + * @return the name of the scalar output of the referenced function + */ + std::string CNormalizeDistanceNode::GetScalarOutputName() + { + Lib3MF_uint32 bytesNeededScalarOutputName = 0; + Lib3MF_uint32 bytesWrittenScalarOutputName = 0; + CheckError(lib3mf_normalizedistancenode_getscalaroutputname(m_pHandle, 0, &bytesNeededScalarOutputName, nullptr)); + std::vector bufferScalarOutputName(bytesNeededScalarOutputName); + CheckError(lib3mf_normalizedistancenode_getscalaroutputname(m_pHandle, bytesNeededScalarOutputName, &bytesWrittenScalarOutputName, &bufferScalarOutputName[0])); + + return std::string(&bufferScalarOutputName[0]); + } + + /** + * CNormalizeDistanceNode::SetVectorInputName - Sets the name of the referenced vector input + * @param[in] sVectorInputName - the name of the vector input (float3) of the referenced function + */ + void CNormalizeDistanceNode::SetVectorInputName(const std::string & sVectorInputName) + { + CheckError(lib3mf_normalizedistancenode_setvectorinputname(m_pHandle, sVectorInputName.c_str())); + } + + /** + * CNormalizeDistanceNode::GetVectorInputName - Retrieves the name of the referenced vector input + * @return the name of the vector input (float3) of the referenced function + */ + std::string CNormalizeDistanceNode::GetVectorInputName() + { + Lib3MF_uint32 bytesNeededVectorInputName = 0; + Lib3MF_uint32 bytesWrittenVectorInputName = 0; + CheckError(lib3mf_normalizedistancenode_getvectorinputname(m_pHandle, 0, &bytesNeededVectorInputName, nullptr)); + std::vector bufferVectorInputName(bytesNeededVectorInputName); + CheckError(lib3mf_normalizedistancenode_getvectorinputname(m_pHandle, bytesNeededVectorInputName, &bytesWrittenVectorInputName, &bufferVectorInputName[0])); + + return std::string(&bufferVectorInputName[0]); + } + + /** + * CNormalizeDistanceNode::GetOutputResult - Retrieves the normalized result output + * @return the output port for the normalized distance + */ + PImplicitPort CNormalizeDistanceNode::GetOutputResult() + { + Lib3MFHandle hResult = (Lib3MFHandle)nullptr; + CheckError(lib3mf_normalizedistancenode_getoutputresult(m_pHandle, &hResult)); + + if (!hResult) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResult))); + } + + /** + * Method definitions for class CFunctionCallNode + */ + + /** + * CFunctionCallNode::GetInputFunctionID - Retrieves the input for the function id + * @return the input port for the function + */ + PImplicitPort CFunctionCallNode::GetInputFunctionID() + { + Lib3MFHandle hFunction = (Lib3MFHandle)nullptr; + CheckError(lib3mf_functioncallnode_getinputfunctionid(m_pHandle, &hFunction)); + + if (!hFunction) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hFunction))); + } + + /** + * Method definitions for class CNodeIterator + */ + + /** + * CNodeIterator::GetCurrent - Returns the current element + * @return The current element + */ + PImplicitNode CNodeIterator::GetCurrent() + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_nodeiterator_getcurrent(m_pHandle, &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * Method definitions for class CFunction + */ + + /** + * CFunction::GetDisplayName - Retrieves the display name of the function + * @return the display name + */ + std::string CFunction::GetDisplayName() + { + Lib3MF_uint32 bytesNeededDisplayName = 0; + Lib3MF_uint32 bytesWrittenDisplayName = 0; + CheckError(lib3mf_function_getdisplayname(m_pHandle, 0, &bytesNeededDisplayName, nullptr)); + std::vector bufferDisplayName(bytesNeededDisplayName); + CheckError(lib3mf_function_getdisplayname(m_pHandle, bytesNeededDisplayName, &bytesWrittenDisplayName, &bufferDisplayName[0])); + + return std::string(&bufferDisplayName[0]); + } + + /** + * CFunction::SetDisplayName - Sets the display name of the function + * @param[in] sDisplayName - the display name + */ + void CFunction::SetDisplayName(const std::string & sDisplayName) + { + CheckError(lib3mf_function_setdisplayname(m_pHandle, sDisplayName.c_str())); + } + + /** + * CFunction::AddInput - Add an input + * @param[in] sIdentifier - the identifier of the input + * @param[in] sDisplayName - the display name of the input + * @param[in] eType - the type of the input + * @return The added input port + */ + PImplicitPort CFunction::AddInput(const std::string & sIdentifier, const std::string & sDisplayName, const eImplicitPortType eType) + { + Lib3MFHandle hPort = (Lib3MFHandle)nullptr; + CheckError(lib3mf_function_addinput(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), eType, &hPort)); + + if (!hPort) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPort))); + } + + /** + * CFunction::GetInputs - Retrieves the inputs + * @return iterator for the list of inputs + */ + PImplicitPortIterator CFunction::GetInputs() + { + Lib3MFHandle hIterator = (Lib3MFHandle)nullptr; + CheckError(lib3mf_function_getinputs(m_pHandle, &hIterator)); + + if (!hIterator) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hIterator))); + } + + /** + * CFunction::RemoveInput - Removes an input + * @param[in] pInput - The input to be removed + */ + void CFunction::RemoveInput(classParam pInput) + { + Lib3MFHandle hInput = pInput.GetHandle(); + CheckError(lib3mf_function_removeinput(m_pHandle, hInput)); + } + + /** + * CFunction::AddOutput - Add an output + * @param[in] sIdentifier - the identifier of the output + * @param[in] sDisplayName - the display name of the output + * @param[in] eType - the type of the input + * @return The added input port + */ + PImplicitPort CFunction::AddOutput(const std::string & sIdentifier, const std::string & sDisplayName, const eImplicitPortType eType) + { + Lib3MFHandle hPort = (Lib3MFHandle)nullptr; + CheckError(lib3mf_function_addoutput(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), eType, &hPort)); + + if (!hPort) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPort))); + } + + /** + * CFunction::GetOutputs - Retrieves the outputs + * @return iterator for the outputs + */ + PImplicitPortIterator CFunction::GetOutputs() + { + Lib3MFHandle hIterator = (Lib3MFHandle)nullptr; + CheckError(lib3mf_function_getoutputs(m_pHandle, &hIterator)); + + if (!hIterator) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hIterator))); + } + + /** + * CFunction::RemoveOutput - Removes an output + * @param[in] pOutput - The output to be removed + */ + void CFunction::RemoveOutput(classParam pOutput) + { + Lib3MFHandle hOutput = pOutput.GetHandle(); + CheckError(lib3mf_function_removeoutput(m_pHandle, hOutput)); + } + + /** + * CFunction::FindInput - Retrieves an input + * @param[in] sIdentifier - the identifier of the input + * @return the input port + */ + PImplicitPort CFunction::FindInput(const std::string & sIdentifier) + { + Lib3MFHandle hInput = (Lib3MFHandle)nullptr; + CheckError(lib3mf_function_findinput(m_pHandle, sIdentifier.c_str(), &hInput)); + + if (!hInput) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hInput))); + } + + /** + * CFunction::FindOutput - Retrieves an output + * @param[in] sIdentifier - the identifier of the output + * @return the output port + */ + PImplicitPort CFunction::FindOutput(const std::string & sIdentifier) + { + Lib3MFHandle hOutput = (Lib3MFHandle)nullptr; + CheckError(lib3mf_function_findoutput(m_pHandle, sIdentifier.c_str(), &hOutput)); + + if (!hOutput) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hOutput))); + } + + /** + * Method definitions for class CImplicitFunction + */ + + /** + * CImplicitFunction::GetIdentifier - Retrieves the identifier of the function + * @return the identifier + */ + std::string CImplicitFunction::GetIdentifier() + { + Lib3MF_uint32 bytesNeededIdentifier = 0; + Lib3MF_uint32 bytesWrittenIdentifier = 0; + CheckError(lib3mf_implicitfunction_getidentifier(m_pHandle, 0, &bytesNeededIdentifier, nullptr)); + std::vector bufferIdentifier(bytesNeededIdentifier); + CheckError(lib3mf_implicitfunction_getidentifier(m_pHandle, bytesNeededIdentifier, &bytesWrittenIdentifier, &bufferIdentifier[0])); + + return std::string(&bufferIdentifier[0]); + } + + /** + * CImplicitFunction::SetIdentifier - Sets the identifier of the function + * @param[in] sIdentifier - the identifier + */ + void CImplicitFunction::SetIdentifier(const std::string & sIdentifier) + { + CheckError(lib3mf_implicitfunction_setidentifier(m_pHandle, sIdentifier.c_str())); + } + + /** + * CImplicitFunction::AddNode - Add a node + * @param[in] eNodeType - the type of the node + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PImplicitNode CImplicitFunction::AddNode(const eImplicitNodeType eNodeType, const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addnode(m_pHandle, eNodeType, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddSinNode - Add a SinNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PSinNode CImplicitFunction::AddSinNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addsinnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddCosNode - Add a CosNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PCosNode CImplicitFunction::AddCosNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addcosnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddTanNode - Add a TanNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PTanNode CImplicitFunction::AddTanNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addtannode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddArcSinNode - Add a ArcSinNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PArcSinNode CImplicitFunction::AddArcSinNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addarcsinnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddArcCosNode - Add a ArcCosNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PArcCosNode CImplicitFunction::AddArcCosNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addarccosnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddArcTan2Node - Add a ArcTan2Node + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PArcTan2Node CImplicitFunction::AddArcTan2Node(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addarctan2node(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddSinhNode - Add a SinhNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PSinhNode CImplicitFunction::AddSinhNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addsinhnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddCoshNode - Add a CoshNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PCoshNode CImplicitFunction::AddCoshNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addcoshnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddTanhNode - Add a TanhNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PTanhNode CImplicitFunction::AddTanhNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addtanhnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddRoundNode - Add a RoundNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PRoundNode CImplicitFunction::AddRoundNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addroundnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddCeilNode - Add a CeilNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PCeilNode CImplicitFunction::AddCeilNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addceilnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddFloorNode - Add a FloorNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PFloorNode CImplicitFunction::AddFloorNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addfloornode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddSignNode - Add a SignNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PSignNode CImplicitFunction::AddSignNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addsignnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddFractNode - Add a FractNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PFractNode CImplicitFunction::AddFractNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addfractnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddAbsNode - Add a AbsNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PAbsNode CImplicitFunction::AddAbsNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addabsnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddExpNode - Add a ExpNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PExpNode CImplicitFunction::AddExpNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addexpnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddLogNode - Add a LogNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PLogNode CImplicitFunction::AddLogNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addlognode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddLog2Node - Add a Log2Node + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PLog2Node CImplicitFunction::AddLog2Node(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addlog2node(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddLog10Node - Add a Log10Node + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PLog10Node CImplicitFunction::AddLog10Node(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addlog10node(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddLengthNode - Add a LengthNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PLengthNode CImplicitFunction::AddLengthNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addlengthnode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddTransposeNode - Add a TransposeNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PTransposeNode CImplicitFunction::AddTransposeNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addtransposenode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddInverseNode - Add a InverseNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PInverseNode CImplicitFunction::AddInverseNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addinversenode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddSqrtNode - Add a SqrtNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PSqrtNode CImplicitFunction::AddSqrtNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addsqrtnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddResourceIdNode - Add a ResourceIdNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PResourceIdNode CImplicitFunction::AddResourceIdNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addresourceidnode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddAdditionNode - Add an AdditionNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PAdditionNode CImplicitFunction::AddAdditionNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addadditionnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddSubtractionNode - Add a SubtractionNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PSubtractionNode CImplicitFunction::AddSubtractionNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addsubtractionnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddMultiplicationNode - Add a MultiplicationNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PMultiplicationNode CImplicitFunction::AddMultiplicationNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addmultiplicationnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddDivisionNode - Add a DivisionNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PDivisionNode CImplicitFunction::AddDivisionNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_adddivisionnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddDotNode - Add a DotNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PDotNode CImplicitFunction::AddDotNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_adddotnode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddCrossNode - Add a CrossNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PCrossNode CImplicitFunction::AddCrossNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addcrossnode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddMatVecMultiplicationNode - Add a MatVecMultiplicationNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PMatVecMultiplicationNode CImplicitFunction::AddMatVecMultiplicationNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addmatvecmultiplicationnode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddMinNode - Add a MinNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PMinNode CImplicitFunction::AddMinNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addminnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddMaxNode - Add a MaxNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PMaxNode CImplicitFunction::AddMaxNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addmaxnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddFmodNode - Add a FmodNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PFmodNode CImplicitFunction::AddFmodNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addfmodnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddPowNode - Add a PowNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PPowNode CImplicitFunction::AddPowNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addpownode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddSelectNode - Add a SelectNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PSelectNode CImplicitFunction::AddSelectNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addselectnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddClampNode - Add a ClampNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] eConfiguration - the configuration of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PClampNode CImplicitFunction::AddClampNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addclampnode(m_pHandle, sIdentifier.c_str(), eConfiguration, sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddComposeVectorNode - Add a ComposeVectorNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PComposeVectorNode CImplicitFunction::AddComposeVectorNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addcomposevectornode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddVectorFromScalarNode - Add a VectorFromScalar + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PVectorFromScalarNode CImplicitFunction::AddVectorFromScalarNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addvectorfromscalarnode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddDecomposeVectorNode - Add a DecomposeVectorNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PDecomposeVectorNode CImplicitFunction::AddDecomposeVectorNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_adddecomposevectornode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddComposeMatrixNode - Add a ComposeMatrixNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PComposeMatrixNode CImplicitFunction::AddComposeMatrixNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addcomposematrixnode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddMatrixFromRowsNode - Add a MatrixFromRowsNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PMatrixFromRowsNode CImplicitFunction::AddMatrixFromRowsNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addmatrixfromrowsnode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddMatrixFromColumnsNode - Add a MatrixFromColumnsNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PMatrixFromColumnsNode CImplicitFunction::AddMatrixFromColumnsNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addmatrixfromcolumnsnode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddConstantNode - Add a ConstantNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PConstantNode CImplicitFunction::AddConstantNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addconstantnode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddConstVecNode - Add a ConstVecNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PConstVecNode CImplicitFunction::AddConstVecNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addconstvecnode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddConstMatNode - Add a ConstMatNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PConstMatNode CImplicitFunction::AddConstMatNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addconstmatnode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddMeshNode - Add a MeshNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PMeshNode CImplicitFunction::AddMeshNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addmeshnode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddUnsignedMeshNode - Add a UnsignedMeshNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PUnsignedMeshNode CImplicitFunction::AddUnsignedMeshNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addunsignedmeshnode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddBeamLatticeNode - Add a BeamLatticeNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PBeamLatticeNode CImplicitFunction::AddBeamLatticeNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addbeamlatticenode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddFunctionGradientNode - Add a FunctionGradientNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PFunctionGradientNode CImplicitFunction::AddFunctionGradientNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addfunctiongradientnode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddNormalizeDistanceNode - Add a NormalizeDistanceNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PNormalizeDistanceNode CImplicitFunction::AddNormalizeDistanceNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addnormalizedistancenode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddFunctionCallNode - Add a FunctionCallNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PFunctionCallNode CImplicitFunction::AddFunctionCallNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addfunctioncallnode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::GetNodes - Retrieves the nodes + * @return iterator for the list of nodes + */ + PNodeIterator CImplicitFunction::GetNodes() + { + Lib3MFHandle hIterator = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_getnodes(m_pHandle, &hIterator)); + + if (!hIterator) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hIterator))); + } + + /** + * CImplicitFunction::RemoveNode - Removes a node + * @param[in] pNode - The node to be removed + */ + void CImplicitFunction::RemoveNode(classParam pNode) + { + Lib3MFHandle hNode = pNode.GetHandle(); + CheckError(lib3mf_implicitfunction_removenode(m_pHandle, hNode)); + } + + /** + * CImplicitFunction::AddLink - Add a link + * @param[in] pSource - the source port + * @param[in] pTarget - the target port + */ + void CImplicitFunction::AddLink(classParam pSource, classParam pTarget) + { + Lib3MFHandle hSource = pSource.GetHandle(); + Lib3MFHandle hTarget = pTarget.GetHandle(); + CheckError(lib3mf_implicitfunction_addlink(m_pHandle, hSource, hTarget)); + } + + /** + * CImplicitFunction::AddLinkByNames - Add a link + * @param[in] sSource - name of the source port in the format nodename.portname + * @param[in] sTarget - name of the target port in the format nodename.portname + */ + void CImplicitFunction::AddLinkByNames(const std::string & sSource, const std::string & sTarget) + { + CheckError(lib3mf_implicitfunction_addlinkbynames(m_pHandle, sSource.c_str(), sTarget.c_str())); + } + + /** + * CImplicitFunction::Clear - Clears the function + */ + void CImplicitFunction::Clear() + { + CheckError(lib3mf_implicitfunction_clear(m_pHandle)); + } + + /** + * CImplicitFunction::SortNodesTopologically - Sorts the nodes topologically + */ + void CImplicitFunction::SortNodesTopologically() + { + CheckError(lib3mf_implicitfunction_sortnodestopologically(m_pHandle)); + } + + /** + * Method definitions for class CFunctionFromImage3D + */ + + /** + * CFunctionFromImage3D::GetImage3D - Returns the selected 3D image. + * @return image instance + */ + PImage3D CFunctionFromImage3D::GetImage3D() + { + Lib3MFHandle hImage3D = (Lib3MFHandle)nullptr; + CheckError(lib3mf_functionfromimage3d_getimage3d(m_pHandle, &hImage3D)); + + if (!hImage3D) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hImage3D))); + } + + /** + * CFunctionFromImage3D::SetImage3D - Sets the 3D image of the selector. + * @param[in] pImage3D - image instance + */ + void CFunctionFromImage3D::SetImage3D(classParam pImage3D) + { + Lib3MFHandle hImage3D = pImage3D.GetHandle(); + CheckError(lib3mf_functionfromimage3d_setimage3d(m_pHandle, hImage3D)); + } + + /** + * CFunctionFromImage3D::SetFilter - Sets the texture filter of the selector. + * @param[in] eFilter - texture filter + */ + void CFunctionFromImage3D::SetFilter(const eTextureFilter eFilter) + { + CheckError(lib3mf_functionfromimage3d_setfilter(m_pHandle, eFilter)); + } + + /** + * CFunctionFromImage3D::GetFilter - Returns the texture filter of the selector. + * @return texture filter + */ + eTextureFilter CFunctionFromImage3D::GetFilter() + { + eTextureFilter resultFilter = (eTextureFilter) 0; + CheckError(lib3mf_functionfromimage3d_getfilter(m_pHandle, &resultFilter)); + + return resultFilter; + } + + /** + * CFunctionFromImage3D::SetTileStyles - Sets the tile styles of the selector. + * @param[in] eTileStyleU - tile style in U + * @param[in] eTileStyleV - tile style in V + * @param[in] eTileStyleW - tile style in W + */ + void CFunctionFromImage3D::SetTileStyles(const eTextureTileStyle eTileStyleU, const eTextureTileStyle eTileStyleV, const eTextureTileStyle eTileStyleW) + { + CheckError(lib3mf_functionfromimage3d_settilestyles(m_pHandle, eTileStyleU, eTileStyleV, eTileStyleW)); + } + + /** + * CFunctionFromImage3D::GetTileStyles - Retrieves the tile styles of the selector. + * @param[out] eTileStyleU - tile style in U + * @param[out] eTileStyleV - tile style in V + * @param[out] eTileStyleW - tile style in W + */ + void CFunctionFromImage3D::GetTileStyles(eTextureTileStyle & eTileStyleU, eTextureTileStyle & eTileStyleV, eTextureTileStyle & eTileStyleW) + { + CheckError(lib3mf_functionfromimage3d_gettilestyles(m_pHandle, &eTileStyleU, &eTileStyleV, &eTileStyleW)); + } + + /** + * CFunctionFromImage3D::GetOffset - returns the offset value for the pixel values in the Image3D + * @return the offset value for the pixel values in the Image3D + */ + Lib3MF_double CFunctionFromImage3D::GetOffset() + { + Lib3MF_double resultOffset = 0; + CheckError(lib3mf_functionfromimage3d_getoffset(m_pHandle, &resultOffset)); + + return resultOffset; + } + + /** + * CFunctionFromImage3D::SetOffset - Sets the offset value for the pixel values in the Image3D + * @param[in] dOffset - the offset value for the pixel values in the Image3D + */ + void CFunctionFromImage3D::SetOffset(const Lib3MF_double dOffset) + { + CheckError(lib3mf_functionfromimage3d_setoffset(m_pHandle, dOffset)); + } + + /** + * CFunctionFromImage3D::GetScale - returns the scale value for the pixel values in the Image3D + * @return the scale value for the pixel values in the Image3D + */ + Lib3MF_double CFunctionFromImage3D::GetScale() + { + Lib3MF_double resultScale = 0; + CheckError(lib3mf_functionfromimage3d_getscale(m_pHandle, &resultScale)); + + return resultScale; + } + + /** + * CFunctionFromImage3D::SetScale - Sets the scale value for the pixel values in the Image3D + * @param[in] dScale - the scale value for the pixel values in the Image3D + */ + void CFunctionFromImage3D::SetScale(const Lib3MF_double dScale) + { + CheckError(lib3mf_functionfromimage3d_setscale(m_pHandle, dScale)); + } + /** * Method definitions for class CBuildItem */ @@ -4346,13 +10772,13 @@ public: */ PObject CBuildItem::GetObjectResource() { - Lib3MFHandle hObjectResource = nullptr; + Lib3MFHandle hObjectResource = (Lib3MFHandle)nullptr; CheckError(lib3mf_builditem_getobjectresource(m_pHandle, &hObjectResource)); if (!hObjectResource) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hObjectResource); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hObjectResource))); } /** @@ -4455,13 +10881,13 @@ public: */ PMetaDataGroup CBuildItem::GetMetaDataGroup() { - Lib3MFHandle hMetaDataGroup = nullptr; + Lib3MFHandle hMetaDataGroup = (Lib3MFHandle)nullptr; CheckError(lib3mf_builditem_getmetadatagroup(m_pHandle, &hMetaDataGroup)); if (!hMetaDataGroup) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hMetaDataGroup); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaDataGroup))); } /** @@ -4510,13 +10936,13 @@ public: */ PBuildItem CBuildItemIterator::GetCurrent() { - Lib3MFHandle hBuildItem = nullptr; + Lib3MFHandle hBuildItem = (Lib3MFHandle)nullptr; CheckError(lib3mf_builditemiterator_getcurrent(m_pHandle, &hBuildItem)); if (!hBuildItem) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hBuildItem); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBuildItem))); } /** @@ -4525,13 +10951,13 @@ public: */ PBuildItemIterator CBuildItemIterator::Clone() { - Lib3MFHandle hOutBuildItemIterator = nullptr; + Lib3MFHandle hOutBuildItemIterator = (Lib3MFHandle)nullptr; CheckError(lib3mf_builditemiterator_clone(m_pHandle, &hOutBuildItemIterator)); if (!hOutBuildItemIterator) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hOutBuildItemIterator); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hOutBuildItemIterator))); } /** @@ -4556,7 +10982,8 @@ public: */ void CSlice::SetVertices(const CInputVector & VerticesBuffer) { - CheckError(lib3mf_slice_setvertices(m_pHandle, (Lib3MF_uint64)VerticesBuffer.size(), VerticesBuffer.data())); + Lib3MF_uint64 nVerticesSize = VerticesBuffer.size(); + CheckError(lib3mf_slice_setvertices(m_pHandle, nVerticesSize, VerticesBuffer.data())); } /** @@ -4591,8 +11018,9 @@ public: */ Lib3MF_uint64 CSlice::AddPolygon(const CInputVector & IndicesBuffer) { + Lib3MF_uint64 nIndicesSize = IndicesBuffer.size(); Lib3MF_uint64 resultIndex = 0; - CheckError(lib3mf_slice_addpolygon(m_pHandle, (Lib3MF_uint64)IndicesBuffer.size(), IndicesBuffer.data(), &resultIndex)); + CheckError(lib3mf_slice_addpolygon(m_pHandle, nIndicesSize, IndicesBuffer.data(), &resultIndex)); return resultIndex; } @@ -4616,7 +11044,8 @@ public: */ void CSlice::SetPolygonIndices(const Lib3MF_uint64 nIndex, const CInputVector & IndicesBuffer) { - CheckError(lib3mf_slice_setpolygonindices(m_pHandle, nIndex, (Lib3MF_uint64)IndicesBuffer.size(), IndicesBuffer.data())); + Lib3MF_uint64 nIndicesSize = IndicesBuffer.size(); + CheckError(lib3mf_slice_setpolygonindices(m_pHandle, nIndex, nIndicesSize, IndicesBuffer.data())); } /** @@ -4693,13 +11122,13 @@ public: */ PSlice CSliceStack::GetSlice(const Lib3MF_uint64 nSliceIndex) { - Lib3MFHandle hTheSlice = nullptr; + Lib3MFHandle hTheSlice = (Lib3MFHandle)nullptr; CheckError(lib3mf_slicestack_getslice(m_pHandle, nSliceIndex, &hTheSlice)); if (!hTheSlice) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hTheSlice); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheSlice))); } /** @@ -4709,13 +11138,13 @@ public: */ PSlice CSliceStack::AddSlice(const Lib3MF_double dZTop) { - Lib3MFHandle hTheSlice = nullptr; + Lib3MFHandle hTheSlice = (Lib3MFHandle)nullptr; CheckError(lib3mf_slicestack_addslice(m_pHandle, dZTop, &hTheSlice)); if (!hTheSlice) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hTheSlice); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheSlice))); } /** @@ -4734,12 +11163,9 @@ public: * CSliceStack::AddSliceStackReference - Adds another existing slicestack as sliceref in this slicestack * @param[in] pTheSliceStack - the slicestack to use as sliceref */ - void CSliceStack::AddSliceStackReference(CSliceStack * pTheSliceStack) + void CSliceStack::AddSliceStackReference(classParam pTheSliceStack) { - Lib3MFHandle hTheSliceStack = nullptr; - if (pTheSliceStack != nullptr) { - hTheSliceStack = pTheSliceStack->GetHandle(); - }; + Lib3MFHandle hTheSliceStack = pTheSliceStack.GetHandle(); CheckError(lib3mf_slicestack_addslicestackreference(m_pHandle, hTheSliceStack)); } @@ -4750,13 +11176,13 @@ public: */ PSliceStack CSliceStack::GetSliceStackReference(const Lib3MF_uint64 nSliceRefIndex) { - Lib3MFHandle hTheSliceStack = nullptr; + Lib3MFHandle hTheSliceStack = (Lib3MFHandle)nullptr; CheckError(lib3mf_slicestack_getslicestackreference(m_pHandle, nSliceRefIndex, &hTheSliceStack)); if (!hTheSliceStack) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hTheSliceStack); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheSliceStack))); } /** @@ -4850,13 +11276,13 @@ public: */ PConsumer CAccessRight::GetConsumer() { - Lib3MFHandle hConsumer = nullptr; + Lib3MFHandle hConsumer = (Lib3MFHandle)nullptr; CheckError(lib3mf_accessright_getconsumer(m_pHandle, &hConsumer)); if (!hConsumer) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hConsumer); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hConsumer))); } /** @@ -4956,7 +11382,8 @@ public: */ void CContentEncryptionParams::SetAuthenticationTag(const CInputVector & ByteDataBuffer) { - CheckError(lib3mf_contentencryptionparams_setauthenticationtag(m_pHandle, (Lib3MF_uint64)ByteDataBuffer.size(), ByteDataBuffer.data())); + Lib3MF_uint64 nByteDataSize = ByteDataBuffer.size(); + CheckError(lib3mf_contentencryptionparams_setauthenticationtag(m_pHandle, nByteDataSize, ByteDataBuffer.data())); } /** @@ -5009,13 +11436,13 @@ public: */ PPackagePart CResourceData::GetPath() { - Lib3MFHandle hPath = nullptr; + Lib3MFHandle hPath = (Lib3MFHandle)nullptr; CheckError(lib3mf_resourcedata_getpath(m_pHandle, &hPath)); if (!hPath) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hPath); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPath))); } /** @@ -5082,19 +11509,16 @@ public: * @param[in] eDigestMethod - The digest mechanism to be used * @return The acess right instance */ - PAccessRight CResourceDataGroup::AddAccessRight(CConsumer * pConsumer, const eWrappingAlgorithm eWrappingAlgorithm, const eMgfAlgorithm eMgfAlgorithm, const eDigestMethod eDigestMethod) + PAccessRight CResourceDataGroup::AddAccessRight(classParam pConsumer, const eWrappingAlgorithm eWrappingAlgorithm, const eMgfAlgorithm eMgfAlgorithm, const eDigestMethod eDigestMethod) { - Lib3MFHandle hConsumer = nullptr; - if (pConsumer != nullptr) { - hConsumer = pConsumer->GetHandle(); - }; - Lib3MFHandle hTheAccessRight = nullptr; + Lib3MFHandle hConsumer = pConsumer.GetHandle(); + Lib3MFHandle hTheAccessRight = (Lib3MFHandle)nullptr; CheckError(lib3mf_resourcedatagroup_addaccessright(m_pHandle, hConsumer, eWrappingAlgorithm, eMgfAlgorithm, eDigestMethod, &hTheAccessRight)); if (!hTheAccessRight) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hTheAccessRight); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheAccessRight))); } /** @@ -5102,17 +11526,14 @@ public: * @param[in] pConsumer - The Consumer instance * @return The AcessRight instance */ - PAccessRight CResourceDataGroup::FindAccessRightByConsumer(CConsumer * pConsumer) + PAccessRight CResourceDataGroup::FindAccessRightByConsumer(classParam pConsumer) { - Lib3MFHandle hConsumer = nullptr; - if (pConsumer != nullptr) { - hConsumer = pConsumer->GetHandle(); - }; - Lib3MFHandle hTheAccessRight = nullptr; + Lib3MFHandle hConsumer = pConsumer.GetHandle(); + Lib3MFHandle hTheAccessRight = (Lib3MFHandle)nullptr; CheckError(lib3mf_resourcedatagroup_findaccessrightbyconsumer(m_pHandle, hConsumer, &hTheAccessRight)); if (hTheAccessRight) { - return std::make_shared(m_pWrapper, hTheAccessRight); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheAccessRight))); } else { return nullptr; } @@ -5122,12 +11543,9 @@ public: * CResourceDataGroup::RemoveAccessRight - Removes access from a Consumer on this resource data group * @param[in] pConsumer - The Consumer instance */ - void CResourceDataGroup::RemoveAccessRight(CConsumer * pConsumer) + void CResourceDataGroup::RemoveAccessRight(classParam pConsumer) { - Lib3MFHandle hConsumer = nullptr; - if (pConsumer != nullptr) { - hConsumer = pConsumer->GetHandle(); - }; + Lib3MFHandle hConsumer = pConsumer.GetHandle(); CheckError(lib3mf_resourcedatagroup_removeaccessright(m_pHandle, hConsumer)); } @@ -5144,13 +11562,13 @@ public: */ PConsumer CKeyStore::AddConsumer(const std::string & sConsumerID, const std::string & sKeyID, const std::string & sKeyValue) { - Lib3MFHandle hConsumer = nullptr; + Lib3MFHandle hConsumer = (Lib3MFHandle)nullptr; CheckError(lib3mf_keystore_addconsumer(m_pHandle, sConsumerID.c_str(), sKeyID.c_str(), sKeyValue.c_str(), &hConsumer)); if (!hConsumer) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hConsumer); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hConsumer))); } /** @@ -5172,25 +11590,22 @@ public: */ PConsumer CKeyStore::GetConsumer(const Lib3MF_uint64 nConsumerIndex) { - Lib3MFHandle hConsumer = nullptr; + Lib3MFHandle hConsumer = (Lib3MFHandle)nullptr; CheckError(lib3mf_keystore_getconsumer(m_pHandle, nConsumerIndex, &hConsumer)); if (!hConsumer) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hConsumer); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hConsumer))); } /** * CKeyStore::RemoveConsumer - Removes a consumer from the keystore * @param[in] pConsumer - The consumer instance to remove */ - void CKeyStore::RemoveConsumer(CConsumer * pConsumer) + void CKeyStore::RemoveConsumer(classParam pConsumer) { - Lib3MFHandle hConsumer = nullptr; - if (pConsumer != nullptr) { - hConsumer = pConsumer->GetHandle(); - }; + Lib3MFHandle hConsumer = pConsumer.GetHandle(); CheckError(lib3mf_keystore_removeconsumer(m_pHandle, hConsumer)); } @@ -5201,11 +11616,11 @@ public: */ PConsumer CKeyStore::FindConsumer(const std::string & sConsumerID) { - Lib3MFHandle hConsumer = nullptr; + Lib3MFHandle hConsumer = (Lib3MFHandle)nullptr; CheckError(lib3mf_keystore_findconsumer(m_pHandle, sConsumerID.c_str(), &hConsumer)); if (hConsumer) { - return std::make_shared(m_pWrapper, hConsumer); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hConsumer))); } else { return nullptr; } @@ -5229,13 +11644,13 @@ public: */ PResourceDataGroup CKeyStore::AddResourceDataGroup() { - Lib3MFHandle hResourceDataGroup = nullptr; + Lib3MFHandle hResourceDataGroup = (Lib3MFHandle)nullptr; CheckError(lib3mf_keystore_addresourcedatagroup(m_pHandle, &hResourceDataGroup)); if (!hResourceDataGroup) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResourceDataGroup); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceDataGroup))); } /** @@ -5245,25 +11660,22 @@ public: */ PResourceDataGroup CKeyStore::GetResourceDataGroup(const Lib3MF_uint64 nResourceDataIndex) { - Lib3MFHandle hResourceDataGroup = nullptr; + Lib3MFHandle hResourceDataGroup = (Lib3MFHandle)nullptr; CheckError(lib3mf_keystore_getresourcedatagroup(m_pHandle, nResourceDataIndex, &hResourceDataGroup)); if (!hResourceDataGroup) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResourceDataGroup); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceDataGroup))); } /** * CKeyStore::RemoveResourceDataGroup - Removes a resource data group * @param[in] pResourceDataGroup - The resource data group instance */ - void CKeyStore::RemoveResourceDataGroup(CResourceDataGroup * pResourceDataGroup) + void CKeyStore::RemoveResourceDataGroup(classParam pResourceDataGroup) { - Lib3MFHandle hResourceDataGroup = nullptr; - if (pResourceDataGroup != nullptr) { - hResourceDataGroup = pResourceDataGroup->GetHandle(); - }; + Lib3MFHandle hResourceDataGroup = pResourceDataGroup.GetHandle(); CheckError(lib3mf_keystore_removeresourcedatagroup(m_pHandle, hResourceDataGroup)); } @@ -5272,17 +11684,14 @@ public: * @param[in] pPartPath - The target path for the resourcedata hold by the resource data group * @return The data resource instance */ - PResourceDataGroup CKeyStore::FindResourceDataGroup(CPackagePart * pPartPath) + PResourceDataGroup CKeyStore::FindResourceDataGroup(classParam pPartPath) { - Lib3MFHandle hPartPath = nullptr; - if (pPartPath != nullptr) { - hPartPath = pPartPath->GetHandle(); - }; - Lib3MFHandle hResourceDataGroup = nullptr; + Lib3MFHandle hPartPath = pPartPath.GetHandle(); + Lib3MFHandle hResourceDataGroup = (Lib3MFHandle)nullptr; CheckError(lib3mf_keystore_findresourcedatagroup(m_pHandle, hPartPath, &hResourceDataGroup)); if (hResourceDataGroup) { - return std::make_shared(m_pWrapper, hResourceDataGroup); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceDataGroup))); } else { return nullptr; } @@ -5297,35 +11706,27 @@ public: * @param[in] AdditionalAuthenticationDataBuffer - Additional data to be encrypted along the contents for better security * @return The data resource instance */ - PResourceData CKeyStore::AddResourceData(CResourceDataGroup * pResourceDataGroup, CPackagePart * pPartPath, const eEncryptionAlgorithm eAlgorithm, const eCompression eCompression, const CInputVector & AdditionalAuthenticationDataBuffer) + PResourceData CKeyStore::AddResourceData(classParam pResourceDataGroup, classParam pPartPath, const eEncryptionAlgorithm eAlgorithm, const eCompression eCompression, const CInputVector & AdditionalAuthenticationDataBuffer) { - Lib3MFHandle hResourceDataGroup = nullptr; - if (pResourceDataGroup != nullptr) { - hResourceDataGroup = pResourceDataGroup->GetHandle(); - }; - Lib3MFHandle hPartPath = nullptr; - if (pPartPath != nullptr) { - hPartPath = pPartPath->GetHandle(); - }; - Lib3MFHandle hResourceData = nullptr; - CheckError(lib3mf_keystore_addresourcedata(m_pHandle, hResourceDataGroup, hPartPath, eAlgorithm, eCompression, (Lib3MF_uint64)AdditionalAuthenticationDataBuffer.size(), AdditionalAuthenticationDataBuffer.data(), &hResourceData)); + Lib3MFHandle hResourceDataGroup = pResourceDataGroup.GetHandle(); + Lib3MFHandle hPartPath = pPartPath.GetHandle(); + Lib3MF_uint64 nAdditionalAuthenticationDataSize = AdditionalAuthenticationDataBuffer.size(); + Lib3MFHandle hResourceData = (Lib3MFHandle)nullptr; + CheckError(lib3mf_keystore_addresourcedata(m_pHandle, hResourceDataGroup, hPartPath, eAlgorithm, eCompression, nAdditionalAuthenticationDataSize, AdditionalAuthenticationDataBuffer.data(), &hResourceData)); if (!hResourceData) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResourceData); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceData))); } /** * CKeyStore::RemoveResourceData - Removes a resource data * @param[in] pResourceData - The resource data to be removed */ - void CKeyStore::RemoveResourceData(CResourceData * pResourceData) + void CKeyStore::RemoveResourceData(classParam pResourceData) { - Lib3MFHandle hResourceData = nullptr; - if (pResourceData != nullptr) { - hResourceData = pResourceData->GetHandle(); - }; + Lib3MFHandle hResourceData = pResourceData.GetHandle(); CheckError(lib3mf_keystore_removeresourcedata(m_pHandle, hResourceData)); } @@ -5334,17 +11735,14 @@ public: * @param[in] pResourcePath - The target path for the resourcedata * @return The resource data instance */ - PResourceData CKeyStore::FindResourceData(CPackagePart * pResourcePath) + PResourceData CKeyStore::FindResourceData(classParam pResourcePath) { - Lib3MFHandle hResourcePath = nullptr; - if (pResourcePath != nullptr) { - hResourcePath = pResourcePath->GetHandle(); - }; - Lib3MFHandle hResourceData = nullptr; + Lib3MFHandle hResourcePath = pResourcePath.GetHandle(); + Lib3MFHandle hResourceData = (Lib3MFHandle)nullptr; CheckError(lib3mf_keystore_findresourcedata(m_pHandle, hResourcePath, &hResourceData)); if (hResourceData) { - return std::make_shared(m_pWrapper, hResourceData); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceData))); } else { return nullptr; } @@ -5369,13 +11767,13 @@ public: */ PResourceData CKeyStore::GetResourceData(const Lib3MF_uint64 nResourceDataIndex) { - Lib3MFHandle hResourceData = nullptr; + Lib3MFHandle hResourceData = (Lib3MFHandle)nullptr; CheckError(lib3mf_keystore_getresourcedata(m_pHandle, nResourceDataIndex, &hResourceData)); if (!hResourceData) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResourceData); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceData))); } /** @@ -5413,13 +11811,13 @@ public: */ PPackagePart CModel::RootModelPart() { - Lib3MFHandle hRootModelPart = nullptr; + Lib3MFHandle hRootModelPart = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_rootmodelpart(m_pHandle, &hRootModelPart)); if (!hRootModelPart) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hRootModelPart); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hRootModelPart))); } /** @@ -5429,13 +11827,13 @@ public: */ PPackagePart CModel::FindOrCreatePackagePart(const std::string & sAbsolutePath) { - Lib3MFHandle hModelPart = nullptr; + Lib3MFHandle hModelPart = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_findorcreatepackagepart(m_pHandle, sAbsolutePath.c_str(), &hModelPart)); if (!hModelPart) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hModelPart); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hModelPart))); } /** @@ -5490,13 +11888,13 @@ public: */ PWriter CModel::QueryWriter(const std::string & sWriterClass) { - Lib3MFHandle hWriterInstance = nullptr; + Lib3MFHandle hWriterInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_querywriter(m_pHandle, sWriterClass.c_str(), &hWriterInstance)); if (!hWriterInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hWriterInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hWriterInstance))); } /** @@ -5506,13 +11904,29 @@ public: */ PReader CModel::QueryReader(const std::string & sReaderClass) { - Lib3MFHandle hReaderInstance = nullptr; + Lib3MFHandle hReaderInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_queryreader(m_pHandle, sReaderClass.c_str(), &hReaderInstance)); if (!hReaderInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hReaderInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hReaderInstance))); + } + + /** + * CModel::GetResourceByID - finds a model resource by its UniqueResourceID + * @param[in] nUniqueResourceID - UniqueResourceID + * @return returns the resource instance + */ + PResource CModel::GetResourceByID(const Lib3MF_uint32 nUniqueResourceID) + { + Lib3MFHandle hResource = (Lib3MFHandle)nullptr; + CheckError(lib3mf_model_getresourcebyid(m_pHandle, nUniqueResourceID, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } /** @@ -5522,13 +11936,13 @@ public: */ PTexture2D CModel::GetTexture2DByID(const Lib3MF_uint32 nUniqueResourceID) { - Lib3MFHandle hTextureInstance = nullptr; + Lib3MFHandle hTextureInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_gettexture2dbyid(m_pHandle, nUniqueResourceID, &hTextureInstance)); if (!hTextureInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hTextureInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTextureInstance))); } /** @@ -5551,13 +11965,13 @@ public: */ PBaseMaterialGroup CModel::GetBaseMaterialGroupByID(const Lib3MF_uint32 nUniqueResourceID) { - Lib3MFHandle hBaseMaterialGroupInstance = nullptr; + Lib3MFHandle hBaseMaterialGroupInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getbasematerialgroupbyid(m_pHandle, nUniqueResourceID, &hBaseMaterialGroupInstance)); if (!hBaseMaterialGroupInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hBaseMaterialGroupInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBaseMaterialGroupInstance))); } /** @@ -5567,13 +11981,13 @@ public: */ PTexture2DGroup CModel::GetTexture2DGroupByID(const Lib3MF_uint32 nUniqueResourceID) { - Lib3MFHandle hTexture2DGroupInstance = nullptr; + Lib3MFHandle hTexture2DGroupInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_gettexture2dgroupbyid(m_pHandle, nUniqueResourceID, &hTexture2DGroupInstance)); if (!hTexture2DGroupInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hTexture2DGroupInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTexture2DGroupInstance))); } /** @@ -5583,13 +11997,13 @@ public: */ PCompositeMaterials CModel::GetCompositeMaterialsByID(const Lib3MF_uint32 nUniqueResourceID) { - Lib3MFHandle hCompositeMaterialsInstance = nullptr; + Lib3MFHandle hCompositeMaterialsInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getcompositematerialsbyid(m_pHandle, nUniqueResourceID, &hCompositeMaterialsInstance)); if (!hCompositeMaterialsInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hCompositeMaterialsInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hCompositeMaterialsInstance))); } /** @@ -5599,13 +12013,13 @@ public: */ PMultiPropertyGroup CModel::GetMultiPropertyGroupByID(const Lib3MF_uint32 nUniqueResourceID) { - Lib3MFHandle hMultiPropertyGroupInstance = nullptr; + Lib3MFHandle hMultiPropertyGroupInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getmultipropertygroupbyid(m_pHandle, nUniqueResourceID, &hMultiPropertyGroupInstance)); if (!hMultiPropertyGroupInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hMultiPropertyGroupInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMultiPropertyGroupInstance))); } /** @@ -5615,13 +12029,13 @@ public: */ PMeshObject CModel::GetMeshObjectByID(const Lib3MF_uint32 nUniqueResourceID) { - Lib3MFHandle hMeshObjectInstance = nullptr; + Lib3MFHandle hMeshObjectInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getmeshobjectbyid(m_pHandle, nUniqueResourceID, &hMeshObjectInstance)); if (!hMeshObjectInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hMeshObjectInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMeshObjectInstance))); } /** @@ -5631,13 +12045,13 @@ public: */ PComponentsObject CModel::GetComponentsObjectByID(const Lib3MF_uint32 nUniqueResourceID) { - Lib3MFHandle hComponentsObjectInstance = nullptr; + Lib3MFHandle hComponentsObjectInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getcomponentsobjectbyid(m_pHandle, nUniqueResourceID, &hComponentsObjectInstance)); if (!hComponentsObjectInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hComponentsObjectInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hComponentsObjectInstance))); } /** @@ -5647,13 +12061,13 @@ public: */ PColorGroup CModel::GetColorGroupByID(const Lib3MF_uint32 nUniqueResourceID) { - Lib3MFHandle hColorGroupInstance = nullptr; + Lib3MFHandle hColorGroupInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getcolorgroupbyid(m_pHandle, nUniqueResourceID, &hColorGroupInstance)); if (!hColorGroupInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hColorGroupInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hColorGroupInstance))); } /** @@ -5663,13 +12077,29 @@ public: */ PSliceStack CModel::GetSliceStackByID(const Lib3MF_uint32 nUniqueResourceID) { - Lib3MFHandle hSliceStacInstance = nullptr; + Lib3MFHandle hSliceStacInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getslicestackbyid(m_pHandle, nUniqueResourceID, &hSliceStacInstance)); if (!hSliceStacInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hSliceStacInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hSliceStacInstance))); + } + + /** + * CModel::GetLevelSetByID - finds a level set object by its UniqueResourceID + * @param[in] nUniqueResourceID - UniqueResourceID + * @return returns the level set object instance + */ + PLevelSet CModel::GetLevelSetByID(const Lib3MF_uint32 nUniqueResourceID) + { + Lib3MFHandle hLevelSetObjectInstance = (Lib3MFHandle)nullptr; + CheckError(lib3mf_model_getlevelsetbyid(m_pHandle, nUniqueResourceID, &hLevelSetObjectInstance)); + + if (!hLevelSetObjectInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hLevelSetObjectInstance))); } /** @@ -5703,13 +12133,13 @@ public: */ PBuildItemIterator CModel::GetBuildItems() { - Lib3MFHandle hBuildItemIterator = nullptr; + Lib3MFHandle hBuildItemIterator = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getbuilditems(m_pHandle, &hBuildItemIterator)); if (!hBuildItemIterator) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hBuildItemIterator); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBuildItemIterator))); } /** @@ -5730,13 +12160,13 @@ public: */ PResourceIterator CModel::GetResources() { - Lib3MFHandle hResourceIterator = nullptr; + Lib3MFHandle hResourceIterator = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getresources(m_pHandle, &hResourceIterator)); if (!hResourceIterator) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResourceIterator); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); } /** @@ -5745,13 +12175,13 @@ public: */ PObjectIterator CModel::GetObjects() { - Lib3MFHandle hResourceIterator = nullptr; + Lib3MFHandle hResourceIterator = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getobjects(m_pHandle, &hResourceIterator)); if (!hResourceIterator) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResourceIterator); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); } /** @@ -5760,13 +12190,13 @@ public: */ PMeshObjectIterator CModel::GetMeshObjects() { - Lib3MFHandle hResourceIterator = nullptr; + Lib3MFHandle hResourceIterator = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getmeshobjects(m_pHandle, &hResourceIterator)); if (!hResourceIterator) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResourceIterator); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); } /** @@ -5775,13 +12205,13 @@ public: */ PComponentsObjectIterator CModel::GetComponentsObjects() { - Lib3MFHandle hResourceIterator = nullptr; + Lib3MFHandle hResourceIterator = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getcomponentsobjects(m_pHandle, &hResourceIterator)); if (!hResourceIterator) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResourceIterator); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); } /** @@ -5790,13 +12220,13 @@ public: */ PTexture2DIterator CModel::GetTexture2Ds() { - Lib3MFHandle hResourceIterator = nullptr; + Lib3MFHandle hResourceIterator = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_gettexture2ds(m_pHandle, &hResourceIterator)); if (!hResourceIterator) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResourceIterator); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); } /** @@ -5805,13 +12235,13 @@ public: */ PBaseMaterialGroupIterator CModel::GetBaseMaterialGroups() { - Lib3MFHandle hResourceIterator = nullptr; + Lib3MFHandle hResourceIterator = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getbasematerialgroups(m_pHandle, &hResourceIterator)); if (!hResourceIterator) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResourceIterator); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); } /** @@ -5820,13 +12250,13 @@ public: */ PColorGroupIterator CModel::GetColorGroups() { - Lib3MFHandle hResourceIterator = nullptr; + Lib3MFHandle hResourceIterator = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getcolorgroups(m_pHandle, &hResourceIterator)); if (!hResourceIterator) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResourceIterator); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); } /** @@ -5835,13 +12265,13 @@ public: */ PTexture2DGroupIterator CModel::GetTexture2DGroups() { - Lib3MFHandle hResourceIterator = nullptr; + Lib3MFHandle hResourceIterator = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_gettexture2dgroups(m_pHandle, &hResourceIterator)); if (!hResourceIterator) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResourceIterator); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); } /** @@ -5850,13 +12280,13 @@ public: */ PCompositeMaterialsIterator CModel::GetCompositeMaterials() { - Lib3MFHandle hResourceIterator = nullptr; + Lib3MFHandle hResourceIterator = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getcompositematerials(m_pHandle, &hResourceIterator)); if (!hResourceIterator) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResourceIterator); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); } /** @@ -5865,13 +12295,13 @@ public: */ PMultiPropertyGroupIterator CModel::GetMultiPropertyGroups() { - Lib3MFHandle hResourceIterator = nullptr; + Lib3MFHandle hResourceIterator = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getmultipropertygroups(m_pHandle, &hResourceIterator)); if (!hResourceIterator) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResourceIterator); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); } /** @@ -5880,13 +12310,28 @@ public: */ PSliceStackIterator CModel::GetSliceStacks() { - Lib3MFHandle hResourceIterator = nullptr; + Lib3MFHandle hResourceIterator = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getslicestacks(m_pHandle, &hResourceIterator)); if (!hResourceIterator) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hResourceIterator); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); + } + + /** + * CModel::GetImage3Ds - creates a resource iterator instance with all image3d resources. + * @return returns the iterator instance. + */ + PImage3DIterator CModel::GetImage3Ds() + { + Lib3MFHandle hResourceIterator = (Lib3MFHandle)nullptr; + CheckError(lib3mf_model_getimage3ds(m_pHandle, &hResourceIterator)); + + if (!hResourceIterator) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); } /** @@ -5895,13 +12340,23 @@ public: */ PModel CModel::MergeToModel() { - Lib3MFHandle hMergedModelInstance = nullptr; + Lib3MFHandle hMergedModelInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_mergetomodel(m_pHandle, &hMergedModelInstance)); if (!hMergedModelInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hMergedModelInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMergedModelInstance))); + } + + /** + * CModel::MergeFromModel - Merges the given model into this model. + * @param[in] pModelInstance - model to be merged + */ + void CModel::MergeFromModel(classParam pModelInstance) + { + Lib3MFHandle hModelInstance = pModelInstance.GetHandle(); + CheckError(lib3mf_model_mergefrommodel(m_pHandle, hModelInstance)); } /** @@ -5910,13 +12365,13 @@ public: */ PMeshObject CModel::AddMeshObject() { - Lib3MFHandle hMeshObjectInstance = nullptr; + Lib3MFHandle hMeshObjectInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_addmeshobject(m_pHandle, &hMeshObjectInstance)); if (!hMeshObjectInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hMeshObjectInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMeshObjectInstance))); } /** @@ -5925,13 +12380,13 @@ public: */ PComponentsObject CModel::AddComponentsObject() { - Lib3MFHandle hComponentsObjectInstance = nullptr; + Lib3MFHandle hComponentsObjectInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_addcomponentsobject(m_pHandle, &hComponentsObjectInstance)); if (!hComponentsObjectInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hComponentsObjectInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hComponentsObjectInstance))); } /** @@ -5941,13 +12396,13 @@ public: */ PSliceStack CModel::AddSliceStack(const Lib3MF_double dZBottom) { - Lib3MFHandle hSliceStackInstance = nullptr; + Lib3MFHandle hSliceStackInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_addslicestack(m_pHandle, dZBottom, &hSliceStackInstance)); if (!hSliceStackInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hSliceStackInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hSliceStackInstance))); } /** @@ -5955,19 +12410,16 @@ public: * @param[in] pTextureAttachment - attachment containing the image data. * @return returns the new texture instance. */ - PTexture2D CModel::AddTexture2DFromAttachment(CAttachment * pTextureAttachment) + PTexture2D CModel::AddTexture2DFromAttachment(classParam pTextureAttachment) { - Lib3MFHandle hTextureAttachment = nullptr; - if (pTextureAttachment != nullptr) { - hTextureAttachment = pTextureAttachment->GetHandle(); - }; - Lib3MFHandle hTexture2DInstance = nullptr; + Lib3MFHandle hTextureAttachment = pTextureAttachment.GetHandle(); + Lib3MFHandle hTexture2DInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_addtexture2dfromattachment(m_pHandle, hTextureAttachment, &hTexture2DInstance)); if (!hTexture2DInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hTexture2DInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTexture2DInstance))); } /** @@ -5976,13 +12428,13 @@ public: */ PBaseMaterialGroup CModel::AddBaseMaterialGroup() { - Lib3MFHandle hBaseMaterialGroupInstance = nullptr; + Lib3MFHandle hBaseMaterialGroupInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_addbasematerialgroup(m_pHandle, &hBaseMaterialGroupInstance)); if (!hBaseMaterialGroupInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hBaseMaterialGroupInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBaseMaterialGroupInstance))); } /** @@ -5991,13 +12443,13 @@ public: */ PColorGroup CModel::AddColorGroup() { - Lib3MFHandle hColorGroupInstance = nullptr; + Lib3MFHandle hColorGroupInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_addcolorgroup(m_pHandle, &hColorGroupInstance)); if (!hColorGroupInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hColorGroupInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hColorGroupInstance))); } /** @@ -6005,19 +12457,16 @@ public: * @param[in] pTexture2DInstance - The texture2D instance of the created Texture2DGroup. * @return returns the new Texture2DGroup instance. */ - PTexture2DGroup CModel::AddTexture2DGroup(CTexture2D * pTexture2DInstance) + PTexture2DGroup CModel::AddTexture2DGroup(classParam pTexture2DInstance) { - Lib3MFHandle hTexture2DInstance = nullptr; - if (pTexture2DInstance != nullptr) { - hTexture2DInstance = pTexture2DInstance->GetHandle(); - }; - Lib3MFHandle hTexture2DGroupInstance = nullptr; + Lib3MFHandle hTexture2DInstance = pTexture2DInstance.GetHandle(); + Lib3MFHandle hTexture2DGroupInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_addtexture2dgroup(m_pHandle, hTexture2DInstance, &hTexture2DGroupInstance)); if (!hTexture2DGroupInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hTexture2DGroupInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTexture2DGroupInstance))); } /** @@ -6025,19 +12474,16 @@ public: * @param[in] pBaseMaterialGroupInstance - The BaseMaterialGroup instance of the created CompositeMaterials. * @return returns the new CompositeMaterials instance. */ - PCompositeMaterials CModel::AddCompositeMaterials(CBaseMaterialGroup * pBaseMaterialGroupInstance) + PCompositeMaterials CModel::AddCompositeMaterials(classParam pBaseMaterialGroupInstance) { - Lib3MFHandle hBaseMaterialGroupInstance = nullptr; - if (pBaseMaterialGroupInstance != nullptr) { - hBaseMaterialGroupInstance = pBaseMaterialGroupInstance->GetHandle(); - }; - Lib3MFHandle hCompositeMaterialsInstance = nullptr; + Lib3MFHandle hBaseMaterialGroupInstance = pBaseMaterialGroupInstance.GetHandle(); + Lib3MFHandle hCompositeMaterialsInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_addcompositematerials(m_pHandle, hBaseMaterialGroupInstance, &hCompositeMaterialsInstance)); if (!hCompositeMaterialsInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hCompositeMaterialsInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hCompositeMaterialsInstance))); } /** @@ -6046,13 +12492,47 @@ public: */ PMultiPropertyGroup CModel::AddMultiPropertyGroup() { - Lib3MFHandle hMultiPropertyGroupInstance = nullptr; + Lib3MFHandle hMultiPropertyGroupInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_addmultipropertygroup(m_pHandle, &hMultiPropertyGroupInstance)); if (!hMultiPropertyGroupInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hMultiPropertyGroupInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMultiPropertyGroupInstance))); + } + + /** + * CModel::AddImageStack - creates a new 3D Image Resource + * @param[in] nColumnCount - the number of columns in each sheet. + * @param[in] nRowCount - the number of rows in each sheet. + * @param[in] nSheetCount - the number of sheets in the image stack. + * @return returns the new ImageStack instance + */ + PImageStack CModel::AddImageStack(const Lib3MF_uint32 nColumnCount, const Lib3MF_uint32 nRowCount, const Lib3MF_uint32 nSheetCount) + { + Lib3MFHandle hInstance = (Lib3MFHandle)nullptr; + CheckError(lib3mf_model_addimagestack(m_pHandle, nColumnCount, nRowCount, nSheetCount, &hInstance)); + + if (!hInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hInstance))); + } + + /** + * CModel::GetImageStackByID - finds an ImageStack object by its UniqueResourceID + * @param[in] nUniqueResourceID - UniqueResourceID + * @return returns the image stack instance + */ + PImageStack CModel::GetImageStackByID(const Lib3MF_uint32 nUniqueResourceID) + { + Lib3MFHandle hImageStackInstance = (Lib3MFHandle)nullptr; + CheckError(lib3mf_model_getimagestackbyid(m_pHandle, nUniqueResourceID, &hImageStackInstance)); + + if (!hImageStackInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hImageStackInstance))); } /** @@ -6061,31 +12541,25 @@ public: * @param[in] Transform - Transformation matrix. * @return returns the build item instance. */ - PBuildItem CModel::AddBuildItem(CObject * pObject, const sTransform & Transform) + PBuildItem CModel::AddBuildItem(classParam pObject, const sTransform & Transform) { - Lib3MFHandle hObject = nullptr; - if (pObject != nullptr) { - hObject = pObject->GetHandle(); - }; - Lib3MFHandle hBuildItemInstance = nullptr; + Lib3MFHandle hObject = pObject.GetHandle(); + Lib3MFHandle hBuildItemInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_addbuilditem(m_pHandle, hObject, &Transform, &hBuildItemInstance)); if (!hBuildItemInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hBuildItemInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBuildItemInstance))); } /** * CModel::RemoveBuildItem - removes a build item from the model * @param[in] pBuildItemInstance - Build item to remove. */ - void CModel::RemoveBuildItem(CBuildItem * pBuildItemInstance) + void CModel::RemoveBuildItem(classParam pBuildItemInstance) { - Lib3MFHandle hBuildItemInstance = nullptr; - if (pBuildItemInstance != nullptr) { - hBuildItemInstance = pBuildItemInstance->GetHandle(); - }; + Lib3MFHandle hBuildItemInstance = pBuildItemInstance.GetHandle(); CheckError(lib3mf_model_removebuilditem(m_pHandle, hBuildItemInstance)); } @@ -6095,13 +12569,13 @@ public: */ PMetaDataGroup CModel::GetMetaDataGroup() { - Lib3MFHandle hTheMetaDataGroup = nullptr; + Lib3MFHandle hTheMetaDataGroup = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getmetadatagroup(m_pHandle, &hTheMetaDataGroup)); if (!hTheMetaDataGroup) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hTheMetaDataGroup); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheMetaDataGroup))); } /** @@ -6112,25 +12586,22 @@ public: */ PAttachment CModel::AddAttachment(const std::string & sURI, const std::string & sRelationShipType) { - Lib3MFHandle hAttachmentInstance = nullptr; + Lib3MFHandle hAttachmentInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_addattachment(m_pHandle, sURI.c_str(), sRelationShipType.c_str(), &hAttachmentInstance)); if (!hAttachmentInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hAttachmentInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttachmentInstance))); } /** * CModel::RemoveAttachment - Removes attachment from the model. * @param[in] pAttachmentInstance - Attachment instance to remove */ - void CModel::RemoveAttachment(CAttachment * pAttachmentInstance) + void CModel::RemoveAttachment(classParam pAttachmentInstance) { - Lib3MFHandle hAttachmentInstance = nullptr; - if (pAttachmentInstance != nullptr) { - hAttachmentInstance = pAttachmentInstance->GetHandle(); - }; + Lib3MFHandle hAttachmentInstance = pAttachmentInstance.GetHandle(); CheckError(lib3mf_model_removeattachment(m_pHandle, hAttachmentInstance)); } @@ -6141,13 +12612,13 @@ public: */ PAttachment CModel::GetAttachment(const Lib3MF_uint32 nIndex) { - Lib3MFHandle hAttachmentInstance = nullptr; + Lib3MFHandle hAttachmentInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getattachment(m_pHandle, nIndex, &hAttachmentInstance)); if (!hAttachmentInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hAttachmentInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttachmentInstance))); } /** @@ -6157,13 +12628,13 @@ public: */ PAttachment CModel::FindAttachment(const std::string & sURI) { - Lib3MFHandle hAttachmentInstance = nullptr; + Lib3MFHandle hAttachmentInstance = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_findattachment(m_pHandle, sURI.c_str(), &hAttachmentInstance)); if (!hAttachmentInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hAttachmentInstance); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttachmentInstance))); } /** @@ -6196,13 +12667,13 @@ public: */ PAttachment CModel::CreatePackageThumbnailAttachment() { - Lib3MFHandle hAttachment = nullptr; + Lib3MFHandle hAttachment = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_createpackagethumbnailattachment(m_pHandle, &hAttachment)); if (!hAttachment) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hAttachment); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttachment))); } /** @@ -6211,11 +12682,11 @@ public: */ PAttachment CModel::GetPackageThumbnailAttachment() { - Lib3MFHandle hAttachment = nullptr; + Lib3MFHandle hAttachment = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getpackagethumbnailattachment(m_pHandle, &hAttachment)); if (hAttachment) { - return std::make_shared(m_pWrapper, hAttachment); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttachment))); } else { return nullptr; } @@ -6264,13 +12735,115 @@ public: */ PKeyStore CModel::GetKeyStore() { - Lib3MFHandle hKeyStore = nullptr; + Lib3MFHandle hKeyStore = (Lib3MFHandle)nullptr; CheckError(lib3mf_model_getkeystore(m_pHandle, &hKeyStore)); if (!hKeyStore) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hKeyStore); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hKeyStore))); + } + + /** + * CModel::GetFunctions - creates a resource iterator for all functions + * @return returns the resource iterator + */ + PFunctionIterator CModel::GetFunctions() + { + Lib3MFHandle hTheResourceIterator = (Lib3MFHandle)nullptr; + CheckError(lib3mf_model_getfunctions(m_pHandle, &hTheResourceIterator)); + + if (!hTheResourceIterator) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheResourceIterator))); + } + + /** + * CModel::AddImplicitFunction - adds a function described by nodes to the model + * @return returns the function instance + */ + PImplicitFunction CModel::AddImplicitFunction() + { + Lib3MFHandle hFunctionInstance = (Lib3MFHandle)nullptr; + CheckError(lib3mf_model_addimplicitfunction(m_pHandle, &hFunctionInstance)); + + if (!hFunctionInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hFunctionInstance))); + } + + /** + * CModel::AddFunctionFromImage3D - adds a function defined by an image3d to the model + * @param[in] pImage3DInstance - the Image3D-instance used for this function + * @return returns the function instance + */ + PFunctionFromImage3D CModel::AddFunctionFromImage3D(classParam pImage3DInstance) + { + Lib3MFHandle hImage3DInstance = pImage3DInstance.GetHandle(); + Lib3MFHandle hFunctionInstance = (Lib3MFHandle)nullptr; + CheckError(lib3mf_model_addfunctionfromimage3d(m_pHandle, hImage3DInstance, &hFunctionInstance)); + + if (!hFunctionInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hFunctionInstance))); + } + + /** + * CModel::AddVolumeData - adds a volume data resource to the model. + * @return returns the new volume data instance. + */ + PVolumeData CModel::AddVolumeData() + { + Lib3MFHandle hVolumeDataInstance = (Lib3MFHandle)nullptr; + CheckError(lib3mf_model_addvolumedata(m_pHandle, &hVolumeDataInstance)); + + if (!hVolumeDataInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hVolumeDataInstance))); + } + + /** + * CModel::AddLevelSet - adds an empty boundary shape object to the model. + * @return returns the mesh object instance + */ + PLevelSet CModel::AddLevelSet() + { + Lib3MFHandle hLevelSetInstance = (Lib3MFHandle)nullptr; + CheckError(lib3mf_model_addlevelset(m_pHandle, &hLevelSetInstance)); + + if (!hLevelSetInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hLevelSetInstance))); + } + + /** + * CModel::GetLevelSets - creates a resource iterator instance with all boundary shape resources. + * @return returns the iterator instance. + */ + PLevelSetIterator CModel::GetLevelSets() + { + Lib3MFHandle hResourceIterator = (Lib3MFHandle)nullptr; + CheckError(lib3mf_model_getlevelsets(m_pHandle, &hResourceIterator)); + + if (!hResourceIterator) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); + } + + /** + * CModel::RemoveResource - Removes a resource from the model + * @param[in] pResource - The resource to remove + */ + void CModel::RemoveResource(classParam pResource) + { + Lib3MFHandle hResource = pResource.GetHandle(); + CheckError(lib3mf_model_removeresource(m_pHandle, hResource)); } } // namespace Lib3MF diff --git a/lib3mf/Include/lib3mf_types.hpp b/lib3mf/Include/lib3mf_types.hpp index c13c034..2ae400a 100644 --- a/lib3mf/Include/lib3mf_types.hpp +++ b/lib3mf/Include/lib3mf_types.hpp @@ -1,6 +1,6 @@ /*++ -Copyright (C) 2019 3MF Consortium (Original Author) +Copyright (C) 2024 3MF Consortium (Original Author) All rights reserved. @@ -24,12 +24,12 @@ 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. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.6.0. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++-Header file with basic types in order to allow an easy use of the 3MF Library -Interface version: 2.2.0 +Interface version: 2.5.0 */ @@ -83,7 +83,7 @@ typedef void * Lib3MF_pvoid; **************************************************************************************************************************/ #define LIB3MF_VERSION_MAJOR 2 -#define LIB3MF_VERSION_MINOR 2 +#define LIB3MF_VERSION_MINOR 5 #define LIB3MF_VERSION_MICRO 0 #define LIB3MF_VERSION_PRERELEASEINFO "" #define LIB3MF_VERSION_BUILDINFO "" @@ -93,47 +93,117 @@ typedef void * Lib3MF_pvoid; **************************************************************************************************************************/ #define LIB3MF_SUCCESS 0 -#define LIB3MF_ERROR_NOTIMPLEMENTED 1 -#define LIB3MF_ERROR_INVALIDPARAM 2 -#define LIB3MF_ERROR_INVALIDCAST 3 -#define LIB3MF_ERROR_BUFFERTOOSMALL 4 -#define LIB3MF_ERROR_GENERICEXCEPTION 5 -#define LIB3MF_ERROR_COULDNOTLOADLIBRARY 6 -#define LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT 7 -#define LIB3MF_ERROR_INCOMPATIBLEBINARYVERSION 8 -#define LIB3MF_ERROR_CALCULATIONABORTED 10 -#define LIB3MF_ERROR_SHOULDNOTBECALLED 11 -#define LIB3MF_ERROR_READERCLASSUNKNOWN 100 -#define LIB3MF_ERROR_WRITERCLASSUNKNOWN 101 -#define LIB3MF_ERROR_ITERATORINVALIDINDEX 102 -#define LIB3MF_ERROR_INVALIDMODELRESOURCE 103 -#define LIB3MF_ERROR_RESOURCENOTFOUND 104 -#define LIB3MF_ERROR_INVALIDMODEL 105 -#define LIB3MF_ERROR_INVALIDOBJECT 106 -#define LIB3MF_ERROR_INVALIDMESHOBJECT 107 -#define LIB3MF_ERROR_INVALIDCOMPONENTSOBJECT 108 -#define LIB3MF_ERROR_INVALIDCOMPONENT 109 -#define LIB3MF_ERROR_INVALIDBUILDITEM 110 -#define LIB3MF_ERROR_INVALIDBASEMATERIALGROUP 111 -#define LIB3MF_ERROR_INVALIDSLICESTACKRESOURCE 112 -#define LIB3MF_ERROR_INVALIDTEXTURERESOURCE 113 -#define LIB3MF_ERROR_INVALIDCOLORGROUP 114 -#define LIB3MF_ERROR_INVALIDTEXTURE2DGROUP 115 -#define LIB3MF_ERROR_INVALIDCOMPOSITEMATERIALS 116 -#define LIB3MF_ERROR_INVALIDMULTIPROPERTYGROUP 117 -#define LIB3MF_ERROR_INVALIDRESOURCEINDEX 120 -#define LIB3MF_ERROR_ATTACHMENTNOTFOUND 121 -#define LIB3MF_ERROR_FORBIDDENCYCLICREFERENCE 130 -#define LIB3MF_ERROR_INVALIDATTACHMENTSTREAM 131 -#define LIB3MF_ERROR_INVALIDPROPERTYCOUNT 132 -#define LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER 140 -#define LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT 141 -#define LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE 2000 -#define LIB3MF_ERROR_INVALIDKEYSTORE 3000 -#define LIB3MF_ERROR_INVALIDKEYSTORECONSUMER 3001 -#define LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND 3002 -#define LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND 3003 -#define LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED 3004 +#define LIB3MF_ERROR_NOTIMPLEMENTED 1 /** functionality not implemented */ +#define LIB3MF_ERROR_INVALIDPARAM 2 /** an invalid parameter was passed */ +#define LIB3MF_ERROR_INVALIDCAST 3 /** a type cast failed */ +#define LIB3MF_ERROR_BUFFERTOOSMALL 4 /** a provided buffer is too small */ +#define LIB3MF_ERROR_GENERICEXCEPTION 5 /** a generic exception occurred */ +#define LIB3MF_ERROR_COULDNOTLOADLIBRARY 6 /** the library could not be loaded */ +#define LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT 7 /** a required exported symbol could not be found in the library */ +#define LIB3MF_ERROR_INCOMPATIBLEBINARYVERSION 8 /** the version of the binary interface does not match the bindings interface */ +#define LIB3MF_ERROR_CALCULATIONABORTED 10 /** a calculation has been aborted */ +#define LIB3MF_ERROR_SHOULDNOTBECALLED 11 /** functionality should not be called */ +#define LIB3MF_ERROR_READERCLASSUNKNOWN 100 /** the queried reader class is unknown */ +#define LIB3MF_ERROR_WRITERCLASSUNKNOWN 101 /** the queried writer class is unknown */ +#define LIB3MF_ERROR_ITERATORINVALIDINDEX 102 /** the current index of an iterator is invalid */ +#define LIB3MF_ERROR_INVALIDMODELRESOURCE 103 /** no Model Resource has been given */ +#define LIB3MF_ERROR_RESOURCENOTFOUND 104 /** Resource not found */ +#define LIB3MF_ERROR_INVALIDMODEL 105 /** A model is invalid */ +#define LIB3MF_ERROR_INVALIDOBJECT 106 /** An object is invalid */ +#define LIB3MF_ERROR_INVALIDMESHOBJECT 107 /** A mesh object is invalid */ +#define LIB3MF_ERROR_INVALIDCOMPONENTSOBJECT 108 /** A components object is invalid */ +#define LIB3MF_ERROR_INVALIDCOMPONENT 109 /** A component is invalid */ +#define LIB3MF_ERROR_INVALIDBUILDITEM 110 /** A build item is invalid */ +#define LIB3MF_ERROR_INVALIDBASEMATERIALGROUP 111 /** A basematerialgroup is invalid */ +#define LIB3MF_ERROR_INVALIDSLICESTACKRESOURCE 112 /** A slicestack resource is invalid */ +#define LIB3MF_ERROR_INVALIDTEXTURERESOURCE 113 /** A texture resource is invalid */ +#define LIB3MF_ERROR_INVALIDCOLORGROUP 114 /** A color group resource is invalid */ +#define LIB3MF_ERROR_INVALIDTEXTURE2DGROUP 115 /** A texture2d group resource is invalid */ +#define LIB3MF_ERROR_INVALIDCOMPOSITEMATERIALS 116 /** A composite materials resource is invalid */ +#define LIB3MF_ERROR_INVALIDMULTIPROPERTYGROUP 117 /** A MultiPropertyGroup resource is invalid */ +#define LIB3MF_ERROR_INVALIDRESOURCEINDEX 120 /** A resource index is invalid */ +#define LIB3MF_ERROR_ATTACHMENTNOTFOUND 121 /** Attachment not found */ +#define LIB3MF_ERROR_FORBIDDENCYCLICREFERENCE 130 /** A component references one of its ancestors */ +#define LIB3MF_ERROR_INVALIDATTACHMENTSTREAM 131 /** An attachment stream is invalid */ +#define LIB3MF_ERROR_INVALIDPROPERTYCOUNT 132 /** Invalid property count. */ +#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_INVALIDLEVELSET 143 /** A level set is invalid */ +#define LIB3MF_ERROR_COULDNOTFINDTRIANGLESET 144 /** Could not find triangle set */ +#define LIB3MF_ERROR_INVALIDTRIANGLESETINDEX 145 /** Invalid triangle set index */ +#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 size is invalid */ +#define LIB3MF_ERROR_INCOMPATIBLEPORTTYPES 4000 /** Link could not be added, the port types are incompatible */ +#define LIB3MF_ERROR_GRAPHISCYCLIC 4001 /** The functin graph is cyclic. Only dircected graphs are valid and can be topological sorted. */ +#define LIB3MF_ERROR_INPUTNOTSET 4002 /** The input of a node is not set. */ +#define LIB3MF_ERROR_INVALIDNODECONFIGURATION 4003 /** The selected node configuration is not supported */ + +/************************************************************************************************************************* + Error strings for Lib3MF +**************************************************************************************************************************/ + +inline const char * LIB3MF_GETERRORSTRING (Lib3MFResult nErrorCode) { + switch (nErrorCode) { + case LIB3MF_SUCCESS: return "no error"; + 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_INVALIDLEVELSET: return "A level set is invalid"; + case LIB3MF_ERROR_COULDNOTFINDTRIANGLESET: return "Could not find triangle set"; + case LIB3MF_ERROR_INVALIDTRIANGLESETINDEX: return "Invalid triangle set index"; + 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_INCOMPATIBLEPORTTYPES: return "Link could not be added, the port types are incompatible"; + case LIB3MF_ERROR_GRAPHISCYCLIC: return "The functin graph is cyclic. Only dircected graphs are valid and can be topological sorted."; + case LIB3MF_ERROR_INPUTNOTSET: return "The input of a node is not set."; + case LIB3MF_ERROR_INVALIDNODECONFIGURATION: return "The selected node configuration is not supported"; + default: return "unknown error"; + } +} /************************************************************************************************************************* Declaration of handle classes @@ -155,11 +225,22 @@ typedef Lib3MFHandle Lib3MF_ColorGroupIterator; typedef Lib3MFHandle Lib3MF_Texture2DGroupIterator; typedef Lib3MFHandle Lib3MF_CompositeMaterialsIterator; typedef Lib3MFHandle Lib3MF_MultiPropertyGroupIterator; +typedef Lib3MFHandle Lib3MF_Image3DIterator; +typedef Lib3MFHandle Lib3MF_FunctionIterator; +typedef Lib3MFHandle Lib3MF_LevelSetIterator; typedef Lib3MFHandle Lib3MF_MetaData; typedef Lib3MFHandle Lib3MF_MetaDataGroup; +typedef Lib3MFHandle Lib3MF_TriangleSet; typedef Lib3MFHandle Lib3MF_Object; typedef Lib3MFHandle Lib3MF_MeshObject; +typedef Lib3MFHandle Lib3MF_LevelSet; typedef Lib3MFHandle Lib3MF_BeamLattice; +typedef Lib3MFHandle Lib3MF_FunctionReference; +typedef Lib3MFHandle Lib3MF_VolumeDataColor; +typedef Lib3MFHandle Lib3MF_MaterialMapping; +typedef Lib3MFHandle Lib3MF_VolumeDataComposite; +typedef Lib3MFHandle Lib3MF_VolumeDataProperty; +typedef Lib3MFHandle Lib3MF_VolumeData; typedef Lib3MFHandle Lib3MF_Component; typedef Lib3MFHandle Lib3MF_ComponentsObject; typedef Lib3MFHandle Lib3MF_BeamSet; @@ -168,8 +249,74 @@ typedef Lib3MFHandle Lib3MF_ColorGroup; typedef Lib3MFHandle Lib3MF_Texture2DGroup; typedef Lib3MFHandle Lib3MF_CompositeMaterials; typedef Lib3MFHandle Lib3MF_MultiPropertyGroup; +typedef Lib3MFHandle Lib3MF_Image3D; +typedef Lib3MFHandle Lib3MF_ImageStack; typedef Lib3MFHandle Lib3MF_Attachment; typedef Lib3MFHandle Lib3MF_Texture2D; +typedef Lib3MFHandle Lib3MF_ImplicitPort; +typedef Lib3MFHandle Lib3MF_Iterator; +typedef Lib3MFHandle Lib3MF_ImplicitPortIterator; +typedef Lib3MFHandle Lib3MF_ImplicitNode; +typedef Lib3MFHandle Lib3MF_OneInputNode; +typedef Lib3MFHandle Lib3MF_SinNode; +typedef Lib3MFHandle Lib3MF_CosNode; +typedef Lib3MFHandle Lib3MF_TanNode; +typedef Lib3MFHandle Lib3MF_ArcSinNode; +typedef Lib3MFHandle Lib3MF_ArcCosNode; +typedef Lib3MFHandle Lib3MF_ArcTanNode; +typedef Lib3MFHandle Lib3MF_SinhNode; +typedef Lib3MFHandle Lib3MF_CoshNode; +typedef Lib3MFHandle Lib3MF_TanhNode; +typedef Lib3MFHandle Lib3MF_RoundNode; +typedef Lib3MFHandle Lib3MF_CeilNode; +typedef Lib3MFHandle Lib3MF_FloorNode; +typedef Lib3MFHandle Lib3MF_SignNode; +typedef Lib3MFHandle Lib3MF_FractNode; +typedef Lib3MFHandle Lib3MF_AbsNode; +typedef Lib3MFHandle Lib3MF_ExpNode; +typedef Lib3MFHandle Lib3MF_LogNode; +typedef Lib3MFHandle Lib3MF_Log2Node; +typedef Lib3MFHandle Lib3MF_Log10Node; +typedef Lib3MFHandle Lib3MF_LengthNode; +typedef Lib3MFHandle Lib3MF_TransposeNode; +typedef Lib3MFHandle Lib3MF_InverseNode; +typedef Lib3MFHandle Lib3MF_SqrtNode; +typedef Lib3MFHandle Lib3MF_ResourceIdNode; +typedef Lib3MFHandle Lib3MF_TwoInputNode; +typedef Lib3MFHandle Lib3MF_AdditionNode; +typedef Lib3MFHandle Lib3MF_SubtractionNode; +typedef Lib3MFHandle Lib3MF_MultiplicationNode; +typedef Lib3MFHandle Lib3MF_DivisionNode; +typedef Lib3MFHandle Lib3MF_DotNode; +typedef Lib3MFHandle Lib3MF_CrossNode; +typedef Lib3MFHandle Lib3MF_ArcTan2Node; +typedef Lib3MFHandle Lib3MF_MatVecMultiplicationNode; +typedef Lib3MFHandle Lib3MF_MinNode; +typedef Lib3MFHandle Lib3MF_MaxNode; +typedef Lib3MFHandle Lib3MF_FmodNode; +typedef Lib3MFHandle Lib3MF_ModNode; +typedef Lib3MFHandle Lib3MF_PowNode; +typedef Lib3MFHandle Lib3MF_SelectNode; +typedef Lib3MFHandle Lib3MF_ClampNode; +typedef Lib3MFHandle Lib3MF_ComposeVectorNode; +typedef Lib3MFHandle Lib3MF_VectorFromScalarNode; +typedef Lib3MFHandle Lib3MF_DecomposeVectorNode; +typedef Lib3MFHandle Lib3MF_ComposeMatrixNode; +typedef Lib3MFHandle Lib3MF_MatrixFromRowsNode; +typedef Lib3MFHandle Lib3MF_MatrixFromColumnsNode; +typedef Lib3MFHandle Lib3MF_ConstantNode; +typedef Lib3MFHandle Lib3MF_ConstVecNode; +typedef Lib3MFHandle Lib3MF_ConstMatNode; +typedef Lib3MFHandle Lib3MF_MeshNode; +typedef Lib3MFHandle Lib3MF_UnsignedMeshNode; +typedef Lib3MFHandle Lib3MF_BeamLatticeNode; +typedef Lib3MFHandle Lib3MF_FunctionGradientNode; +typedef Lib3MFHandle Lib3MF_NormalizeDistanceNode; +typedef Lib3MFHandle Lib3MF_FunctionCallNode; +typedef Lib3MFHandle Lib3MF_NodeIterator; +typedef Lib3MFHandle Lib3MF_Function; +typedef Lib3MFHandle Lib3MF_ImplicitFunction; +typedef Lib3MFHandle Lib3MF_FunctionFromImage3D; typedef Lib3MFHandle Lib3MF_BuildItem; typedef Lib3MFHandle Lib3MF_BuildItemIterator; typedef Lib3MFHandle Lib3MF_Slice; @@ -215,7 +362,8 @@ namespace Lib3MF { Other = 0, Model = 1, Support = 2, - SolidSupport = 3 + SolidSupport = 3, + Surface = 4 }; enum class eTextureType : Lib3MF_int32 { @@ -250,7 +398,7 @@ namespace Lib3MF { }; enum class eBeamLatticeBallMode : Lib3MF_int32 { - None = 0, + BeamLatticeBallModeNone = 0, Mixed = 1, All = 2 }; @@ -288,30 +436,130 @@ namespace Lib3MF { Multiply = 2 }; + enum class eChannelName : Lib3MF_int32 { + Red = 0, + Green = 1, + Blue = 2, + Alpha = 3 + }; + + enum class eCompositionMethod : Lib3MF_int32 { + WeightedSum = 0, + Multiply = 1, + Min = 2, + Max = 3, + Mask = 4 + }; + + enum class eCompositionSpace : Lib3MF_int32 { + Raw = 0, + LinearColor = 1 + }; + + /** + * enum class eImplicitNodeType - The type of the node + */ + enum class eImplicitNodeType : Lib3MF_int32 { + Addition = 0, /** Adds to values (scalar or vector) */ + Subtraction = 1, /** Subtracts two values (scalar or vector) */ + Multiplication = 2, /** Multiplies two values (scalar or vector) */ + Division = 3, /** Divides two values (scalar or vector) */ + Constant = 4, /** A constant scalar value */ + ConstVec = 5, /** A constant vector value */ + ConstMat = 6, /** A constant matrix value */ + ComposeVector = 7, /** Creates a vector from three scalar values */ + DecomposeVector = 8, /** Decomposes a vector into three scalar values */ + ComposeMatrix = 9, /** Creates a matrix from nine scalar values */ + MatrixFromColumns = 10, /** Creates a matrix from three column vector values */ + MatrixFromRows = 11, /** Creates a matrix from three row vector values */ + Dot = 12, /** Calculates the dot product of two vector values */ + Cross = 13, /** Calculates the cross product of two vector values */ + MatVecMultiplication = 14, /** Multiplies a matrix with a vector */ + Transpose = 15, /** Transposes a matrix */ + Inverse = 16, /** Computes the inverse of a matrix */ + Sinus = 17, /** Calculates the sine */ + Cosinus = 18, /** Calculates the cosine */ + Tan = 19, /** Calculates the tangent */ + ArcSin = 20, /** Calculates the arcsine */ + ArcCos = 21, /** Calculates the arccosine */ + ArcTan = 22, /** Calculates the arctangent */ + ArcTan2 = 23, /** Calculates the arctangent */ + Min = 24, /** Calculates the minimum of two values */ + Max = 25, /** Calculates the maximum of two values */ + Abs = 26, /** Calculates the absolute value */ + Fmod = 27, /** Computes the remainder of the divison of the inputs (same behavior as C fmod) */ + Pow = 28, /** Calculates the power A^B */ + Sqrt = 29, /** Calculates the square root */ + Exp = 30, /** Exponential function */ + Log = 31, /** Natural logarithm */ + Log2 = 32, /** Logarithm to the base 2 */ + Log10 = 33, /** Logarithm to the base 10 */ + Select = 34, /** If A is less than B returns C, else D */ + Clamp = 35, /** Clamps the input value to min and max */ + Sinh = 36, /** Calculates the hyperbolic sine */ + Cosh = 37, /** Calculates the hyperbolic cosine */ + Tanh = 38, /** Calculates the hyperbolic tangent */ + Round = 39, /** Rounds a scalar value to the nearest integer */ + Ceil = 40, /** Rounds a scalar value up to the nearest integer */ + Floor = 41, /** Rounds a scalar value down to the nearest integer */ + Sign = 42, /** Returns the sign */ + Fract = 43, /** Returns the fractional part */ + FunctionCall = 44, /** Calls a function */ + Mesh = 45, /** Calculates the signed distance to a mesh */ + Length = 46, /** Calculates the length of a vector */ + ConstResourceID = 47, /** Selects a resource (function, mesh etc.) */ + VectorFromScalar = 48, /** Creates a vector from one scalar value */ + UnsignedMesh = 49, /** Calculates the unsigned distance to a mesh */ + Mod = 50, /** Calculates the modulo of two values (same behaviour as glsl mod) */ + BeamLattice = 51, /** Calculates the signed distance to a beam lattice */ + FunctionGradient = 52, /** Calculates the gradient of a function */ + NormalizeDistance = 53 /** Normalizes a distance field */ + }; + + /** + * enum class eImplicitPortType - The type of the port + */ + enum class eImplicitPortType : Lib3MF_int32 { + Scalar = 0, /** Scalar */ + Vector = 1, /** Vector */ + Matrix = 2, /** 4x4 Matrix */ + ResourceID = 3 /** Resource ID */ + }; + + /** + * enum class eImplicitNodeConfiguration - Defines the input and output types of a node + */ + enum class eImplicitNodeConfiguration : Lib3MF_int32 { + Default = 0, /** Default */ + ScalarToScalar = 1, /** Scalar -> Scalar */ + VectorToVector = 2, /** Vector -> Vector */ + MatrixToMatrix = 3 /** Matrix -> Matrix */ + }; + enum class eEncryptionAlgorithm : Lib3MF_int32 { - AES256_GCM = 1 + AES256_GCM = 1 /** http://www.w3.org/2009/xmlenc11#aes256-gcm */ }; enum class eWrappingAlgorithm : Lib3MF_int32 { - RSA_OAEP = 0 + RSA_OAEP = 0 /** http://www.w3.org/2009/xmlenc11#rsa-oaep */ }; enum class eMgfAlgorithm : Lib3MF_int32 { - MGF1_SHA1 = 160, - MGF1_SHA224 = 224, - MGF1_SHA256 = 256, - MGF1_SHA384 = 384, - MGF1_SHA512 = 512 + MGF1_SHA1 = 160, /** http://www.w3.org/2009/xmlenc11#mgf1sha1 */ + MGF1_SHA224 = 224, /** http://www.w3.org/2009/xmlenc11#mgf1sha224 */ + MGF1_SHA256 = 256, /** http://www.w3.org/2009/xmlenc11#mgf1sha256 */ + MGF1_SHA384 = 384, /** http://www.w3.org/2009/xmlenc11#mgf1sha384 */ + MGF1_SHA512 = 512 /** http://www.w3.org/2009/xmlenc11#mgf1sha512 */ }; enum class eDigestMethod : Lib3MF_int32 { - SHA1 = 160, - SHA256 = 256 + SHA1 = 160, /** http://www.w3.org/2000/09/xmldsig#sha1 */ + SHA256 = 256 /** http://www.w3.org/2001/04/xmlenc#sha256 */ }; enum class eCompression : Lib3MF_int32 { - NoCompression = 0, - Deflate = 1 + NoCompression = 0, /** No compression applied */ + Deflate = 1 /** Deflate compression applied */ }; /************************************************************************************************************************* @@ -320,65 +568,73 @@ namespace Lib3MF { #pragma pack (1) - typedef struct { + typedef struct sTriangle { Lib3MF_uint32 m_Indices[3]; } sTriangle; - typedef struct { + typedef struct sTriangleProperties { Lib3MF_uint32 m_ResourceID; Lib3MF_uint32 m_PropertyIDs[3]; } sTriangleProperties; - typedef struct { + typedef struct sPosition { Lib3MF_single m_Coordinates[3]; } sPosition; - typedef struct { + typedef struct sPosition2D { Lib3MF_single m_Coordinates[2]; } sPosition2D; - typedef struct { + typedef struct sCompositeConstituent { Lib3MF_uint32 m_PropertyID; Lib3MF_double m_MixingRatio; } sCompositeConstituent; - typedef struct { + typedef struct sMultiPropertyLayer { Lib3MF_uint32 m_ResourceID; eBlendMethod m_TheBlendMethod; } sMultiPropertyLayer; - typedef struct { + typedef struct sTex2Coord { Lib3MF_double m_U; Lib3MF_double m_V; } sTex2Coord; - typedef struct { + typedef struct sTransform { Lib3MF_single m_Fields[4][3]; } sTransform; - typedef struct { + typedef struct sBox { Lib3MF_single m_MinCoordinate[3]; Lib3MF_single m_MaxCoordinate[3]; } sBox; - typedef struct { + typedef struct sColor { Lib3MF_uint8 m_Red; Lib3MF_uint8 m_Green; Lib3MF_uint8 m_Blue; Lib3MF_uint8 m_Alpha; } sColor; - typedef struct { + typedef struct sBeam { Lib3MF_uint32 m_Indices[2]; Lib3MF_double m_Radii[2]; eBeamLatticeCapMode m_CapModes[2]; } sBeam; - typedef struct { + typedef struct sBall { Lib3MF_uint32 m_Index; Lib3MF_double m_Radius; } sBall; + typedef struct sVector { + Lib3MF_double m_Coordinates[3]; + } sVector; + + typedef struct sMatrix4x4 { + Lib3MF_double m_Field[4][4]; + } sMatrix4x4; + #pragma pack () /************************************************************************************************************************* @@ -474,6 +730,12 @@ typedef Lib3MF::eBeamLatticeClipMode eLib3MFBeamLatticeClipMode; typedef Lib3MF::eBeamLatticeBallMode eLib3MFBeamLatticeBallMode; typedef Lib3MF::eProgressIdentifier eLib3MFProgressIdentifier; typedef Lib3MF::eBlendMethod eLib3MFBlendMethod; +typedef Lib3MF::eChannelName eLib3MFChannelName; +typedef Lib3MF::eCompositionMethod eLib3MFCompositionMethod; +typedef Lib3MF::eCompositionSpace eLib3MFCompositionSpace; +typedef Lib3MF::eImplicitNodeType eLib3MFImplicitNodeType; +typedef Lib3MF::eImplicitPortType eLib3MFImplicitPortType; +typedef Lib3MF::eImplicitNodeConfiguration eLib3MFImplicitNodeConfiguration; typedef Lib3MF::eEncryptionAlgorithm eLib3MFEncryptionAlgorithm; typedef Lib3MF::eWrappingAlgorithm eLib3MFWrappingAlgorithm; typedef Lib3MF::eMgfAlgorithm eLib3MFMgfAlgorithm; @@ -491,6 +753,8 @@ typedef Lib3MF::sBox sLib3MFBox; typedef Lib3MF::sColor sLib3MFColor; typedef Lib3MF::sBeam sLib3MFBeam; typedef Lib3MF::sBall sLib3MFBall; +typedef Lib3MF::sVector sLib3MFVector; +typedef Lib3MF::sMatrix4x4 sLib3MFMatrix4x4; typedef Lib3MF::ProgressCallback Lib3MFProgressCallback; typedef Lib3MF::WriteCallback Lib3MFWriteCallback; typedef Lib3MF::ReadCallback Lib3MFReadCallback; diff --git a/lib3mf/Lib/lib3mfD32.lib b/lib3mf/Lib/lib3mfD32.lib index f7a3c7a..1252004 100644 Binary files a/lib3mf/Lib/lib3mfD32.lib and b/lib3mf/Lib/lib3mfD32.lib differ diff --git a/lib3mf/Lib/lib3mfD32.pdb b/lib3mf/Lib/lib3mfD32.pdb index fd0e3ef..c108d55 100644 Binary files a/lib3mf/Lib/lib3mfD32.pdb and b/lib3mf/Lib/lib3mfD32.pdb differ diff --git a/lib3mf/Lib/lib3mfD64.lib b/lib3mf/Lib/lib3mfD64.lib index f5c69b7..e88d877 100644 Binary files a/lib3mf/Lib/lib3mfD64.lib and b/lib3mf/Lib/lib3mfD64.lib differ diff --git a/lib3mf/Lib/lib3mfD64.pdb b/lib3mf/Lib/lib3mfD64.pdb index 34867c7..733f8ce 100644 Binary files a/lib3mf/Lib/lib3mfD64.pdb and b/lib3mf/Lib/lib3mfD64.pdb differ diff --git a/lib3mf/Lib/lib3mfR32.lib b/lib3mf/Lib/lib3mfR32.lib index c7b4bcc..6285e03 100644 Binary files a/lib3mf/Lib/lib3mfR32.lib and b/lib3mf/Lib/lib3mfR32.lib differ diff --git a/lib3mf/Lib/lib3mfR64.lib b/lib3mf/Lib/lib3mfR64.lib index 39ff7c8..d1a2c7d 100644 Binary files a/lib3mf/Lib/lib3mfR64.lib and b/lib3mf/Lib/lib3mfR64.lib differ