Skip to content

Commit

Permalink
Merge pull request #396 from 3MFConsortium/3djan/improveApi
Browse files Browse the repository at this point in the history
3djan/improve api
  • Loading branch information
3dJan authored Nov 15, 2024
2 parents be3289c + 21a268a commit 2c008ec
Show file tree
Hide file tree
Showing 31 changed files with 959 additions and 949 deletions.
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
[submodule "submodules/googletest"]
path = submodules/googletest
url = https://github.com/google/googletest.git

8 changes: 4 additions & 4 deletions Autogenerated/Bindings/C/lib3mf.h
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ 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)
*/
Expand Down Expand Up @@ -3508,7 +3508,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_composematrixnode_getinputm12(Lib3MF_Compose
* Retrieves the input for the element 1 3
*
* @param[in] pComposeMatrixNode - ComposeMatrixNode instance.
* @param[out] pM13 - the input for the m3 element
* @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);
Expand All @@ -3517,7 +3517,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_composematrixnode_getinputm13(Lib3MF_Compose
* Retrieves the input for the element 2 0
*
* @param[in] pComposeMatrixNode - ComposeMatrixNode instance.
* @param[out] pM20 - the input for the m2 element
* @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);
Expand Down Expand Up @@ -4297,7 +4297,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addtransposenode(Lib3MF_Imp
* @param[out] pNode - the added node
* @return error code or 0 (success)
*/
LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_inversenode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_InverseNode * pNode);
LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addinversenode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_InverseNode * pNode);

/**
* Add a SqrtNode
Expand Down
118 changes: 59 additions & 59 deletions Autogenerated/Bindings/C/lib3mf_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,77 +450,77 @@ typedef enum eLib3MFCompositionSpace {
* enum eLib3MFImplicitNodeType - The type of the node
*/
typedef enum eLib3MFImplicitNodeType {
eImplicitNodeTypeAddition = 1, /** Adds to values (scalar or vector) */
eImplicitNodeTypeSubtraction = 2, /** Subtracts two values (scalar or vector) */
eImplicitNodeTypeMultiplication = 3, /** Multiplies two values (scalar or vector) */
eImplicitNodeTypeDivision = 4, /** Divides two values (scalar or vector) */
eImplicitNodeTypeConstant = 5, /** A constant scalar value */
eImplicitNodeTypeConstVec = 6, /** A constant vector value */
eImplicitNodeTypeConstMat = 7, /** A constant matrix value */
eImplicitNodeTypeComposeVector = 8, /** Creates a vector from three scalar values */
eImplicitNodeTypeDecomposeVector = 9, /** Decomposes a vector into three scalar values */
eImplicitNodeTypeComposeMatrix = 10, /** Creates a matrix from nine scalar values */
eImplicitNodeTypeMatrixFromColumns = 11, /** Creates a matrix from three column vector values */
eImplicitNodeTypeMatrixFromRows = 12, /** Creates a matrix from three row vector values */
eImplicitNodeTypeDot = 13, /** Calculates the dot product of two vector values */
eImplicitNodeTypeCross = 14, /** Calculates the cross product of two vector values */
eImplicitNodeTypeMatVecMultiplication = 15, /** Multiplies a matrix with a vector */
eImplicitNodeTypeTranspose = 16, /** Transposes a matrix */
eImplicitNodeTypeInverse = 17, /** Computes the inverse of a matrix */
eImplicitNodeTypeSinus = 18, /** Calculates the sinus */
eImplicitNodeTypeCosinus = 19, /** Calculates the cosinus */
eImplicitNodeTypeTan = 20, /** Calculates the tangent */
eImplicitNodeTypeArcSin = 21, /** Calculates the arcsinus */
eImplicitNodeTypeArcCos = 22, /** Calculates the arccosinus */
eImplicitNodeTypeArcTan = 23, /** Calculates the arctangent */
eImplicitNodeTypeArcTan2 = 24, /** Calculates the arctangent */
eImplicitNodeTypeMin = 25, /** Calculates the minimum tow values */
eImplicitNodeTypeMax = 26, /** Calculates the maximum of two values */
eImplicitNodeTypeAbs = 27, /** Calcul the absolute value */
eImplicitNodeTypeFmod = 28, /** Computes the remainder of the divison of the inputs (same behavior as C fmod) */
eImplicitNodeTypePow = 29, /** Calculates the power A^B */
eImplicitNodeTypeSqrt = 30, /** Calculates the square root */
eImplicitNodeTypeExp = 31, /** Exponential function */
eImplicitNodeTypeLog = 32, /** Natural logarithmus */
eImplicitNodeTypeLog2 = 33, /** Logarithmus to the base 2 */
eImplicitNodeTypeLog10 = 34, /** Logarithmus to the base 10 */
eImplicitNodeTypeSelect = 35, /** If A is less B returns C, else D */
eImplicitNodeTypeClamp = 36, /** Clamps the input value to min and max */
eImplicitNodeTypeSinh = 37, /** Calculates the hyperbolic sine */
eImplicitNodeTypeCosh = 38, /** Calculates the hyperbolic cosine */
eImplicitNodeTypeTanh = 39, /** Calculates the hyperbolic tangent */
eImplicitNodeTypeRound = 40, /** Rounds a scalar value to the nearest integer */
eImplicitNodeTypeCeil = 41, /** Rounds a scalar value up to the nearest integer */
eImplicitNodeTypeFloor = 42, /** Rounds a scalar value down to the nearest integer */
eImplicitNodeTypeSign = 43, /** Returns the sign */
eImplicitNodeTypeFract = 44, /** Returns the fractional part */
eImplicitNodeTypeFunctionCall = 45, /** Calls a function */
eImplicitNodeTypeMesh = 46, /** Calculates the signed distance to a mesh */
eImplicitNodeTypeLength = 47, /** Calculates the length of a vector */
eImplicitNodeTypeConstResourceID = 48, /** Selects a resource (function, mesh etc.) */
eImplicitNodeTypeVectorFromScalar = 49, /** Creates a vector from one scalar values */
eImplicitNodeTypeUnsignedMesh = 50, /** Calculates the unsigned distance to a mesh */
eImplicitNodeTypeMod = 51 /** Calculates the modulo of two values (same behaviour as glsl mod) */
eImplicitNodeTypeAddition = 0, /** Adds to values (scalar or vector) */
eImplicitNodeTypeSubtraction = 1, /** Subtracts two values (scalar or vector) */
eImplicitNodeTypeMultiplication = 2, /** Multiplies two values (scalar or vector) */
eImplicitNodeTypeDivision = 3, /** Divides two values (scalar or vector) */
eImplicitNodeTypeConstant = 4, /** A constant scalar value */
eImplicitNodeTypeConstVec = 5, /** A constant vector value */
eImplicitNodeTypeConstMat = 6, /** A constant matrix value */
eImplicitNodeTypeComposeVector = 7, /** Creates a vector from three scalar values */
eImplicitNodeTypeDecomposeVector = 8, /** Decomposes a vector into three scalar values */
eImplicitNodeTypeComposeMatrix = 9, /** Creates a matrix from nine scalar values */
eImplicitNodeTypeMatrixFromColumns = 10, /** Creates a matrix from three column vector values */
eImplicitNodeTypeMatrixFromRows = 11, /** Creates a matrix from three row vector values */
eImplicitNodeTypeDot = 12, /** Calculates the dot product of two vector values */
eImplicitNodeTypeCross = 13, /** Calculates the cross product of two vector values */
eImplicitNodeTypeMatVecMultiplication = 14, /** Multiplies a matrix with a vector */
eImplicitNodeTypeTranspose = 15, /** Transposes a matrix */
eImplicitNodeTypeInverse = 16, /** Computes the inverse of a matrix */
eImplicitNodeTypeSinus = 17, /** Calculates the sinus */
eImplicitNodeTypeCosinus = 18, /** Calculates the cosinus */
eImplicitNodeTypeTan = 19, /** Calculates the tangent */
eImplicitNodeTypeArcSin = 20, /** Calculates the arcsinus */
eImplicitNodeTypeArcCos = 21, /** Calculates the arccosinus */
eImplicitNodeTypeArcTan = 22, /** Calculates the arctangent */
eImplicitNodeTypeArcTan2 = 23, /** Calculates the arctangent */
eImplicitNodeTypeMin = 24, /** Calculates the minimum of two values */
eImplicitNodeTypeMax = 25, /** Calculates the maximum of two values */
eImplicitNodeTypeAbs = 26, /** Calculates the absolute value */
eImplicitNodeTypeFmod = 27, /** Computes the remainder of the divison of the inputs (same behavior as C fmod) */
eImplicitNodeTypePow = 28, /** Calculates the power A^B */
eImplicitNodeTypeSqrt = 29, /** Calculates the square root */
eImplicitNodeTypeExp = 30, /** Exponential function */
eImplicitNodeTypeLog = 31, /** Natural logarithmus */
eImplicitNodeTypeLog2 = 32, /** Logarithmus to the base 2 */
eImplicitNodeTypeLog10 = 33, /** Logarithmus to the base 10 */
eImplicitNodeTypeSelect = 34, /** If A is less than B returns C, else D */
eImplicitNodeTypeClamp = 35, /** Clamps the input value to min and max */
eImplicitNodeTypeSinh = 36, /** Calculates the hyperbolic sine */
eImplicitNodeTypeCosh = 37, /** Calculates the hyperbolic cosine */
eImplicitNodeTypeTanh = 38, /** Calculates the hyperbolic tangent */
eImplicitNodeTypeRound = 39, /** Rounds a scalar value to the nearest integer */
eImplicitNodeTypeCeil = 40, /** Rounds a scalar value up to the nearest integer */
eImplicitNodeTypeFloor = 41, /** Rounds a scalar value down to the nearest integer */
eImplicitNodeTypeSign = 42, /** Returns the sign */
eImplicitNodeTypeFract = 43, /** Returns the fractional part */
eImplicitNodeTypeFunctionCall = 44, /** Calls a function */
eImplicitNodeTypeMesh = 45, /** Calculates the signed distance to a mesh */
eImplicitNodeTypeLength = 46, /** Calculates the length of a vector */
eImplicitNodeTypeConstResourceID = 47, /** Selects a resource (function, mesh etc.) */
eImplicitNodeTypeVectorFromScalar = 48, /** Creates a vector from one scalar values */
eImplicitNodeTypeUnsignedMesh = 49, /** Calculates the unsigned distance to a mesh */
eImplicitNodeTypeMod = 50 /** Calculates the modulo of two values (same behaviour as glsl mod) */
} eLib3MFImplicitNodeType;

/**
* enum eLib3MFImplicitPortType - The type of the port
*/
typedef enum eLib3MFImplicitPortType {
eImplicitPortTypeScalar = 1, /** Scalar */
eImplicitPortTypeVector = 2, /** Vector */
eImplicitPortTypeMatrix = 3, /** 4x4 Matrix */
eImplicitPortTypeResourceID = 4 /** Resource ID */
eImplicitPortTypeScalar = 0, /** Scalar */
eImplicitPortTypeVector = 1, /** Vector */
eImplicitPortTypeMatrix = 2, /** 4x4 Matrix */
eImplicitPortTypeResourceID = 3 /** Resource ID */
} eLib3MFImplicitPortType;

/**
* enum eLib3MFImplicitNodeConfiguration - Defines the input and output types of a node
*/
typedef enum eLib3MFImplicitNodeConfiguration {
eImplicitNodeConfigurationDefault = 1, /** Default */
eImplicitNodeConfigurationScalarToScalar = 2, /** Scalar -> Scalar */
eImplicitNodeConfigurationVectorToVector = 3, /** Vector -> Vector */
eImplicitNodeConfigurationMatrixToMatrix = 4 /** Matrix -> Matrix */
eImplicitNodeConfigurationDefault = 0, /** Default */
eImplicitNodeConfigurationScalarToScalar = 1, /** Scalar -> Scalar */
eImplicitNodeConfigurationVectorToVector = 2, /** Vector -> Vector */
eImplicitNodeConfigurationMatrixToMatrix = 3 /** Matrix -> Matrix */
} eLib3MFImplicitNodeConfiguration;

typedef enum eLib3MFEncryptionAlgorithm {
Expand Down
8 changes: 4 additions & 4 deletions Autogenerated/Bindings/CDynamic/lib3mf_dynamic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable)
pWrapperTable->m_ImplicitFunction_AddLog10Node = NULL;
pWrapperTable->m_ImplicitFunction_AddLengthNode = NULL;
pWrapperTable->m_ImplicitFunction_AddTransposeNode = NULL;
pWrapperTable->m_ImplicitFunction_InverseNode = NULL;
pWrapperTable->m_ImplicitFunction_AddInverseNode = NULL;
pWrapperTable->m_ImplicitFunction_AddSqrtNode = NULL;
pWrapperTable->m_ImplicitFunction_AddResourceIdNode = NULL;
pWrapperTable->m_ImplicitFunction_AddAdditionNode = NULL;
Expand Down Expand Up @@ -4233,12 +4233,12 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable,
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_ImplicitFunction_InverseNode = (PLib3MFImplicitFunction_InverseNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_inversenode");
pWrapperTable->m_ImplicitFunction_AddInverseNode = (PLib3MFImplicitFunction_AddInverseNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addinversenode");
#else // _WIN32
pWrapperTable->m_ImplicitFunction_InverseNode = (PLib3MFImplicitFunction_InverseNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_inversenode");
pWrapperTable->m_ImplicitFunction_AddInverseNode = (PLib3MFImplicitFunction_AddInverseNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addinversenode");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_ImplicitFunction_InverseNode == NULL)
if (pWrapperTable->m_ImplicitFunction_AddInverseNode == NULL)
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
Expand Down
10 changes: 5 additions & 5 deletions Autogenerated/Bindings/CDynamic/lib3mf_dynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ typedef Lib3MFResult (*PLib3MFMetaDataGroup_RemoveMetaDataPtr) (Lib3MF_MetaDataG
* @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)
*/
Expand Down Expand Up @@ -3495,7 +3495,7 @@ typedef Lib3MFResult (*PLib3MFComposeMatrixNode_GetInputM12Ptr) (Lib3MF_ComposeM
* Retrieves the input for the element 1 3
*
* @param[in] pComposeMatrixNode - ComposeMatrixNode instance.
* @param[out] pM13 - the input for the m3 element
* @param[out] pM13 - the input for the m13 element
* @return error code or 0 (success)
*/
typedef Lib3MFResult (*PLib3MFComposeMatrixNode_GetInputM13Ptr) (Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM13);
Expand All @@ -3504,7 +3504,7 @@ typedef Lib3MFResult (*PLib3MFComposeMatrixNode_GetInputM13Ptr) (Lib3MF_ComposeM
* Retrieves the input for the element 2 0
*
* @param[in] pComposeMatrixNode - ComposeMatrixNode instance.
* @param[out] pM20 - the input for the m2 element
* @param[out] pM20 - the input for the m20 element
* @return error code or 0 (success)
*/
typedef Lib3MFResult (*PLib3MFComposeMatrixNode_GetInputM20Ptr) (Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM20);
Expand Down Expand Up @@ -4284,7 +4284,7 @@ typedef Lib3MFResult (*PLib3MFImplicitFunction_AddTransposeNodePtr) (Lib3MF_Impl
* @param[out] pNode - the added node
* @return error code or 0 (success)
*/
typedef Lib3MFResult (*PLib3MFImplicitFunction_InverseNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_InverseNode * pNode);
typedef Lib3MFResult (*PLib3MFImplicitFunction_AddInverseNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_InverseNode * pNode);

/**
* Add a SqrtNode
Expand Down Expand Up @@ -6836,7 +6836,7 @@ typedef struct {
PLib3MFImplicitFunction_AddLog10NodePtr m_ImplicitFunction_AddLog10Node;
PLib3MFImplicitFunction_AddLengthNodePtr m_ImplicitFunction_AddLengthNode;
PLib3MFImplicitFunction_AddTransposeNodePtr m_ImplicitFunction_AddTransposeNode;
PLib3MFImplicitFunction_InverseNodePtr m_ImplicitFunction_InverseNode;
PLib3MFImplicitFunction_AddInverseNodePtr m_ImplicitFunction_AddInverseNode;
PLib3MFImplicitFunction_AddSqrtNodePtr m_ImplicitFunction_AddSqrtNode;
PLib3MFImplicitFunction_AddResourceIdNodePtr m_ImplicitFunction_AddResourceIdNode;
PLib3MFImplicitFunction_AddAdditionNodePtr m_ImplicitFunction_AddAdditionNode;
Expand Down
Loading

0 comments on commit 2c008ec

Please sign in to comment.