added base 'block' node

This commit is contained in:
itsmattkc
2019-07-27 02:50:22 -07:00
parent 316d12b61d
commit badcade0b6
4 changed files with 75 additions and 2 deletions
+17
View File
@@ -123,6 +123,17 @@ public:
*/
int IndexOfParameter(NodeParam* param);
/**
* @brief Convert a pointer to a value that can be sent between NodeParams
*/
static QVariant PtrToValue(void* ptr);
template<class T>
/**
* @brief Convert a NodeParam value to a pointer of any kind
*/
static T* ValueToPtr(const QVariant& ptr);
public slots:
/**
* @brief The main processing function
@@ -159,4 +170,10 @@ signals:
void EdgeRemoved(NodeEdgePtr edge);
};
template<class T>
T* Node::ValueToPtr(const QVariant &ptr)
{
return reinterpret_cast<T*>(ptr.value<quintptr>());
}
#endif // NODE_H