Skip to content

Commit

Permalink
Introducing ImplicitNodeConfiguration, to set port types during const…
Browse files Browse the repository at this point in the history
…ruction of nodes
  • Loading branch information
3dJan committed Oct 19, 2023
1 parent 43129fe commit ecada92
Show file tree
Hide file tree
Showing 30 changed files with 419 additions and 164 deletions.
3 changes: 2 additions & 1 deletion Autogenerated/Bindings/C/lib3mf.h
Original file line number Diff line number Diff line change
Expand Up @@ -3158,13 +3158,14 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_setidentifier(Lib3MF_Implic
*
* @param[in] pImplicitFunction - ImplicitFunction instance.
* @param[in] eNodeType - the type of the node
* @param[in] eConfiguration - the configuration of the node
* @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_addnode(Lib3MF_ImplicitFunction pImplicitFunction, eLib3MFImplicitNodeType eNodeType, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_ImplicitNode * pNode);
LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addnode(Lib3MF_ImplicitFunction pImplicitFunction, eLib3MFImplicitNodeType eNodeType, eLib3MFImplicitNodeConfiguration eConfiguration, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_ImplicitNode * pNode);

/**
* Retrieves the nodes
Expand Down
20 changes: 20 additions & 0 deletions Autogenerated/Bindings/C/lib3mf_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,21 @@ typedef enum eLib3MFImplicitPortType {
eImplicitPortTypeResourceID = 4 /** 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 */
eImplicitNodeConfigurationScalarScalarToScalar = 5, /** Scalar, Scalar -> Scalar */
eImplicitNodeConfigurationVectorVectorToVector = 6, /** Vector, Vector -> Vector */
eImplicitNodeConfigurationScalarToVector = 8, /** Scalar -> Vector */
eImplicitNodeConfigurationVectorToScalar = 9, /** Vector -> Scalar */
eImplicitNodeConfigurationVectorVectorToScalar = 10 /** Vector, Vector -> Scalar */
} eLib3MFImplicitNodeConfiguration;

typedef enum eLib3MFEncryptionAlgorithm {
eEncryptionAlgorithmAES256_GCM = 1 /** http://www.w3.org/2009/xmlenc11#aes256-gcm */
} eLib3MFEncryptionAlgorithm;
Expand Down Expand Up @@ -561,6 +576,11 @@ typedef union {
int m_code;
} structEnumLib3MFImplicitPortType;

typedef union {
eLib3MFImplicitNodeConfiguration m_enum;
int m_code;
} structEnumLib3MFImplicitNodeConfiguration;

typedef union {
eLib3MFEncryptionAlgorithm m_enum;
int m_code;
Expand Down
3 changes: 2 additions & 1 deletion Autogenerated/Bindings/CDynamic/lib3mf_dynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -3145,13 +3145,14 @@ typedef Lib3MFResult (*PLib3MFImplicitFunction_SetIdentifierPtr) (Lib3MF_Implici
*
* @param[in] pImplicitFunction - ImplicitFunction instance.
* @param[in] eNodeType - the type of the node
* @param[in] eConfiguration - the configuration of the node
* @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)
*/
typedef Lib3MFResult (*PLib3MFImplicitFunction_AddNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, eLib3MFImplicitNodeType eNodeType, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_ImplicitNode * pNode);
typedef Lib3MFResult (*PLib3MFImplicitFunction_AddNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, eLib3MFImplicitNodeType eNodeType, eLib3MFImplicitNodeConfiguration eConfiguration, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_ImplicitNode * pNode);

/**
* Retrieves the nodes
Expand Down
20 changes: 20 additions & 0 deletions Autogenerated/Bindings/CDynamic/lib3mf_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,21 @@ typedef enum eLib3MFImplicitPortType {
eImplicitPortTypeResourceID = 4 /** 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 */
eImplicitNodeConfigurationScalarScalarToScalar = 5, /** Scalar, Scalar -> Scalar */
eImplicitNodeConfigurationVectorVectorToVector = 6, /** Vector, Vector -> Vector */
eImplicitNodeConfigurationScalarToVector = 8, /** Scalar -> Vector */
eImplicitNodeConfigurationVectorToScalar = 9, /** Vector -> Scalar */
eImplicitNodeConfigurationVectorVectorToScalar = 10 /** Vector, Vector -> Scalar */
} eLib3MFImplicitNodeConfiguration;

typedef enum eLib3MFEncryptionAlgorithm {
eEncryptionAlgorithmAES256_GCM = 1 /** http://www.w3.org/2009/xmlenc11#aes256-gcm */
} eLib3MFEncryptionAlgorithm;
Expand Down Expand Up @@ -561,6 +576,11 @@ typedef union {
int m_code;
} structEnumLib3MFImplicitPortType;

typedef union {
eLib3MFImplicitNodeConfiguration m_enum;
int m_code;
} structEnumLib3MFImplicitNodeConfiguration;

typedef union {
eLib3MFEncryptionAlgorithm m_enum;
int m_code;
Expand Down
19 changes: 16 additions & 3 deletions Autogenerated/Bindings/CSharp/Lib3MF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,18 @@ public enum eImplicitPortType {
ResourceID = 4
};

public enum eImplicitNodeConfiguration {
Default = 1,
ScalarToScalar = 2,
VectorToVector = 3,
MatrixToMatrix = 4,
ScalarScalarToScalar = 5,
VectorVectorToVector = 6,
ScalarToVector = 8,
VectorToScalar = 9,
VectorVectorToScalar = 10
};

public enum eEncryptionAlgorithm {
AES256_GCM = 1
};
Expand Down Expand Up @@ -1326,7 +1338,7 @@ public class Lib3MFWrapper
public unsafe extern static Int32 ImplicitFunction_SetIdentifier (IntPtr Handle, byte[] AIdentifier);

[DllImport("lib3mf.dll", EntryPoint = "lib3mf_implicitfunction_addnode", CallingConvention=CallingConvention.Cdecl)]
public unsafe extern static Int32 ImplicitFunction_AddNode (IntPtr Handle, Int32 ANodeType, byte[] AIdentifier, byte[] ADisplayName, byte[] ATag, out IntPtr ANode);
public unsafe extern static Int32 ImplicitFunction_AddNode (IntPtr Handle, Int32 ANodeType, Int32 AConfiguration, byte[] AIdentifier, byte[] ADisplayName, byte[] ATag, out IntPtr ANode);

[DllImport("lib3mf.dll", EntryPoint = "lib3mf_implicitfunction_getnodes", CallingConvention=CallingConvention.Cdecl)]
public unsafe extern static Int32 ImplicitFunction_GetNodes (IntPtr Handle, out IntPtr AIterator);
Expand Down Expand Up @@ -5345,15 +5357,16 @@ public void SetIdentifier (String AIdentifier)
CheckError(Internal.Lib3MFWrapper.ImplicitFunction_SetIdentifier (Handle, byteIdentifier));
}

public CImplicitNode AddNode (eImplicitNodeType ANodeType, String AIdentifier, String ADisplayName, String ATag)
public CImplicitNode AddNode (eImplicitNodeType ANodeType, eImplicitNodeConfiguration AConfiguration, String AIdentifier, String ADisplayName, String ATag)
{
Int32 enumNodeType = (Int32) ANodeType;
Int32 enumConfiguration = (Int32) AConfiguration;
byte[] byteIdentifier = Encoding.UTF8.GetBytes(AIdentifier + char.MinValue);
byte[] byteDisplayName = Encoding.UTF8.GetBytes(ADisplayName + char.MinValue);
byte[] byteTag = Encoding.UTF8.GetBytes(ATag + char.MinValue);
IntPtr newNode = IntPtr.Zero;

CheckError(Internal.Lib3MFWrapper.ImplicitFunction_AddNode (Handle, enumNodeType, byteIdentifier, byteDisplayName, byteTag, out newNode));
CheckError(Internal.Lib3MFWrapper.ImplicitFunction_AddNode (Handle, enumNodeType, enumConfiguration, byteIdentifier, byteDisplayName, byteTag, out newNode));
return Internal.Lib3MFWrapper.PolymorphicFactory<CImplicitNode>(newNode);
}

Expand Down
3 changes: 2 additions & 1 deletion Autogenerated/Bindings/Cpp/lib3mf_abi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3158,13 +3158,14 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_setidentifier(Lib3MF_Implic
*
* @param[in] pImplicitFunction - ImplicitFunction instance.
* @param[in] eNodeType - the type of the node
* @param[in] eConfiguration - the configuration of the node
* @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_addnode(Lib3MF_ImplicitFunction pImplicitFunction, Lib3MF::eImplicitNodeType eNodeType, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_ImplicitNode * pNode);
LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addnode(Lib3MF_ImplicitFunction pImplicitFunction, Lib3MF::eImplicitNodeType eNodeType, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_ImplicitNode * pNode);

/**
* Retrieves the nodes
Expand Down
7 changes: 4 additions & 3 deletions Autogenerated/Bindings/Cpp/lib3mf_implicit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1784,7 +1784,7 @@ class CImplicitFunction : public CFunction {

inline std::string GetIdentifier();
inline void SetIdentifier(const std::string & sIdentifier);
inline PImplicitNode AddNode(const eImplicitNodeType eNodeType, const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag);
inline PImplicitNode AddNode(const eImplicitNodeType eNodeType, const eImplicitNodeConfiguration eConfiguration, const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag);
inline PNodeIterator GetNodes();
inline void RemoveNode(classParam<CImplicitNode> pNode);
inline void AddLink(classParam<CImplicitPort> pSource, classParam<CImplicitPort> pTarget);
Expand Down Expand Up @@ -6373,15 +6373,16 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle)
/**
* CImplicitFunction::AddNode - Add a node
* @param[in] eNodeType - the type of the node
* @param[in] eConfiguration - the configuration of the node
* @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
*/
PImplicitNode CImplicitFunction::AddNode(const eImplicitNodeType eNodeType, const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag)
PImplicitNode CImplicitFunction::AddNode(const eImplicitNodeType eNodeType, const eImplicitNodeConfiguration eConfiguration, const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag)
{
Lib3MFHandle hNode = nullptr;
CheckError(lib3mf_implicitfunction_addnode(m_pHandle, eNodeType, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode));
CheckError(lib3mf_implicitfunction_addnode(m_pHandle, eNodeType, eConfiguration, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode));

if (!hNode) {
CheckError(LIB3MF_ERROR_INVALIDPARAM);
Expand Down
16 changes: 16 additions & 0 deletions Autogenerated/Bindings/Cpp/lib3mf_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,21 @@ namespace Lib3MF {
ResourceID = 4 /** Resource ID */
};

/**
* enum class eImplicitNodeConfiguration - Defines the input and output types of a node
*/
enum class eImplicitNodeConfiguration : Lib3MF_int32 {
Default = 1, /** Default */
ScalarToScalar = 2, /** Scalar -> Scalar */
VectorToVector = 3, /** Vector -> Vector */
MatrixToMatrix = 4, /** Matrix -> Matrix */
ScalarScalarToScalar = 5, /** Scalar, Scalar -> Scalar */
VectorVectorToVector = 6, /** Vector, Vector -> Vector */
ScalarToVector = 8, /** Scalar -> Vector */
VectorToScalar = 9, /** Vector -> Scalar */
VectorVectorToScalar = 10 /** Vector, Vector -> Scalar */
};

enum class eEncryptionAlgorithm : Lib3MF_int32 {
AES256_GCM = 1 /** http://www.w3.org/2009/xmlenc11#aes256-gcm */
};
Expand Down Expand Up @@ -646,6 +661,7 @@ 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;
Expand Down
3 changes: 2 additions & 1 deletion Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -3145,13 +3145,14 @@ typedef Lib3MFResult (*PLib3MFImplicitFunction_SetIdentifierPtr) (Lib3MF_Implici
*
* @param[in] pImplicitFunction - ImplicitFunction instance.
* @param[in] eNodeType - the type of the node
* @param[in] eConfiguration - the configuration of the node
* @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)
*/
typedef Lib3MFResult (*PLib3MFImplicitFunction_AddNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, Lib3MF::eImplicitNodeType eNodeType, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_ImplicitNode * pNode);
typedef Lib3MFResult (*PLib3MFImplicitFunction_AddNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, Lib3MF::eImplicitNodeType eNodeType, Lib3MF::eImplicitNodeConfiguration eConfiguration, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_ImplicitNode * pNode);

/**
* Retrieves the nodes
Expand Down
7 changes: 4 additions & 3 deletions Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1808,7 +1808,7 @@ class CImplicitFunction : public CFunction {

inline std::string GetIdentifier();
inline void SetIdentifier(const std::string & sIdentifier);
inline PImplicitNode AddNode(const eImplicitNodeType eNodeType, const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag);
inline PImplicitNode AddNode(const eImplicitNodeType eNodeType, const eImplicitNodeConfiguration eConfiguration, const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag);
inline PNodeIterator GetNodes();
inline void RemoveNode(classParam<CImplicitNode> pNode);
inline void AddLink(classParam<CImplicitPort> pSource, classParam<CImplicitPort> pTarget);
Expand Down Expand Up @@ -13165,15 +13165,16 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle)
/**
* CImplicitFunction::AddNode - Add a node
* @param[in] eNodeType - the type of the node
* @param[in] eConfiguration - the configuration of the node
* @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
*/
PImplicitNode CImplicitFunction::AddNode(const eImplicitNodeType eNodeType, const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag)
PImplicitNode CImplicitFunction::AddNode(const eImplicitNodeType eNodeType, const eImplicitNodeConfiguration eConfiguration, const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag)
{
Lib3MFHandle hNode = nullptr;
CheckError(m_pWrapper->m_WrapperTable.m_ImplicitFunction_AddNode(m_pHandle, eNodeType, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode));
CheckError(m_pWrapper->m_WrapperTable.m_ImplicitFunction_AddNode(m_pHandle, eNodeType, eConfiguration, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode));

if (!hNode) {
CheckError(LIB3MF_ERROR_INVALIDPARAM);
Expand Down
16 changes: 16 additions & 0 deletions Autogenerated/Bindings/CppDynamic/lib3mf_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,21 @@ namespace Lib3MF {
ResourceID = 4 /** Resource ID */
};

/**
* enum class eImplicitNodeConfiguration - Defines the input and output types of a node
*/
enum class eImplicitNodeConfiguration : Lib3MF_int32 {
Default = 1, /** Default */
ScalarToScalar = 2, /** Scalar -> Scalar */
VectorToVector = 3, /** Vector -> Vector */
MatrixToMatrix = 4, /** Matrix -> Matrix */
ScalarScalarToScalar = 5, /** Scalar, Scalar -> Scalar */
VectorVectorToVector = 6, /** Vector, Vector -> Vector */
ScalarToVector = 8, /** Scalar -> Vector */
VectorToScalar = 9, /** Vector -> Scalar */
VectorVectorToScalar = 10 /** Vector, Vector -> Scalar */
};

enum class eEncryptionAlgorithm : Lib3MF_int32 {
AES256_GCM = 1 /** http://www.w3.org/2009/xmlenc11#aes256-gcm */
};
Expand Down Expand Up @@ -646,6 +661,7 @@ 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;
Expand Down
23 changes: 19 additions & 4 deletions Autogenerated/Bindings/Go/lib3mf.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Autogenerated/Bindings/Go/lib3mf_dynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -3145,13 +3145,14 @@ typedef Lib3MFResult (*PLib3MFImplicitFunction_SetIdentifierPtr) (Lib3MF_Implici
*
* @param[in] pImplicitFunction - ImplicitFunction instance.
* @param[in] eNodeType - the type of the node
* @param[in] eConfiguration - the configuration of the node
* @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)
*/
typedef Lib3MFResult (*PLib3MFImplicitFunction_AddNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, eLib3MFImplicitNodeType eNodeType, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_ImplicitNode * pNode);
typedef Lib3MFResult (*PLib3MFImplicitFunction_AddNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, eLib3MFImplicitNodeType eNodeType, eLib3MFImplicitNodeConfiguration eConfiguration, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_ImplicitNode * pNode);

/**
* Retrieves the nodes
Expand Down
Loading

0 comments on commit ecada92

Please sign in to comment.