don't police data type connections between nodes

Nodes were previously written to be "strongly typed" in that a parameter's
"type" enforced whether it could be connected to another. All code related
to that has now been removed since not only is it hard to maintain and
likely unnecessary, it's possible the nodes will work differently later on
anyway.
This commit is contained in:
itsmattkc
2019-10-25 00:44:14 +11:00
parent 076f2699c5
commit 4d96ac9e39
24 changed files with 83 additions and 249 deletions
+6 -32
View File
@@ -132,7 +132,7 @@ public:
/**
* @brief Name of this parameter to be shown to the user
*/
QString name();
virtual QString name();
void set_name(const QString& name);
/**
@@ -165,30 +165,6 @@ public:
*/
void DisconnectAll();
/**
* @brief Determine whether two DataTypes are compatible and therefore whether two NodeParams can be connected
*
* Obviously a data type is compatible with itself, but sometimes fundamentally separate data types may still be
* allowed to connect (e.g. an integer output to a float input). This static function should be used to determine
* whether a data type is compatible with another.
*/
static bool AreDataTypesCompatible(const DataType& output_type, const DataType& input_type);
/**
* @brief Overload of AreDataTypesCompatible(const DataType& output_type, const DataType& input_type)
*
* Use this for a list of input data types (which NodeInput uses as it's possible for it to accept multiple types).
*/
static bool AreDataTypesCompatible(const DataType& output_type, const QList<DataType>& input_types);
/**
* @brief Overload of AreDataTypesCompatible(const DataType& output_type, const DataType& input_type)
*
* Convenience function for two NodeParams. Determines which is the input/output and determines whether their types
* are compatible.
*/
static bool AreDataTypesCompatible(NodeParam* a, NodeParam* b);
/**
* @brief Connect an output parameter to an input parameter
*
@@ -266,8 +242,6 @@ public:
bool ValueCachingEnabled();
void SetValueCachingEnabled(bool enabled);
virtual DataType data_type() = 0;
signals:
/**
* @brief Signal emitted when an edge is added to this parameter
@@ -307,6 +281,11 @@ protected:
*/
bool value_caching_;
/**
* @brief Internal name string
*/
QString name_;
private:
/**
* @brief Internal function for returning a value in the form of bytes
@@ -314,11 +293,6 @@ private:
template<typename T>
static QByteArray ValueToBytesInternal(const QVariant& v);
/**
* @brief Internal name string
*/
QString name_;
/**
* @brief Internal ID string
*/