minor improvements
This commit is contained in:
@@ -327,6 +327,26 @@ bool Node::OutputsTo(Node *n)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Node::HasInputs()
|
||||
{
|
||||
return HasParamOfType(NodeParam::kInput, false);
|
||||
}
|
||||
|
||||
bool Node::HasOutputs()
|
||||
{
|
||||
return HasParamOfType(NodeParam::kOutput, false);
|
||||
}
|
||||
|
||||
bool Node::HasConnectedInputs()
|
||||
{
|
||||
return HasParamOfType(NodeParam::kInput, true);
|
||||
}
|
||||
|
||||
bool Node::HasConnectedOutputs()
|
||||
{
|
||||
return HasParamOfType(NodeParam::kOutput, true);
|
||||
}
|
||||
|
||||
void Node::Hash(QCryptographicHash *hash, NodeOutput* from, const rational &time)
|
||||
{
|
||||
// Add this Node's ID
|
||||
@@ -373,6 +393,20 @@ bool Node::HasParamWithID(const QString &id)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Node::HasParamOfType(NodeParam::Type type, bool must_be_connected)
|
||||
{
|
||||
QList<NodeParam*> params = parameters();
|
||||
|
||||
foreach (NodeParam* p, params) {
|
||||
if (p->type() == type
|
||||
&& (p->IsConnected() || !must_be_connected)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Node::InputChanged(rational start, rational end)
|
||||
{
|
||||
InvalidateCache(start, end, static_cast<NodeInput*>(sender()));
|
||||
|
||||
@@ -153,6 +153,26 @@ public:
|
||||
*/
|
||||
bool OutputsTo(Node* n);
|
||||
|
||||
/**
|
||||
* @brief Return whether this Node has input parameters
|
||||
*/
|
||||
bool HasInputs();
|
||||
|
||||
/**
|
||||
* @brief Return whether this Node has output parameters
|
||||
*/
|
||||
bool HasOutputs();
|
||||
|
||||
/**
|
||||
* @brief Return whether this Node has input parameters and at least one of them is connected
|
||||
*/
|
||||
bool HasConnectedInputs();
|
||||
|
||||
/**
|
||||
* @brief Return whether this Node has output parameters and at least one of them is connected
|
||||
*/
|
||||
bool HasConnectedOutputs();
|
||||
|
||||
/**
|
||||
* @brief Add's unique information about this Node at the given time to a QCryptographicHash
|
||||
*/
|
||||
@@ -270,6 +290,8 @@ private:
|
||||
*/
|
||||
bool HasParamWithID(const QString& id);
|
||||
|
||||
bool HasParamOfType(NodeParam::Type type, bool must_be_connected);
|
||||
|
||||
/**
|
||||
* @brief The last timecode Process() was called with
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user