remove hashes from nodes

This commit is contained in:
itsmattkc
2022-05-09 18:30:36 -07:00
parent 0538c01f45
commit 08f3cb3cc3
27 changed files with 0 additions and 349 deletions
-65
View File
@@ -864,12 +864,6 @@ int Node::InputArraySize(const QString &id) const
}
}
void Node::Hash(const Node *node, const ValueHint &hint, QCryptographicHash &hash, const NodeGlobals &globals, const VideoParams &video_params)
{
hint.Hash(hash);
node->Hash(hash, globals, video_params);
}
void Node::SetValueHintForInput(const QString &input, const ValueHint &hint, int element)
{
value_hints_.insert({input, element}, hint);
@@ -1184,12 +1178,6 @@ bool Node::AreLinked(Node *a, Node *b)
return a->links_.contains(b);
}
void Node::HashAddNodeSignature(QCryptographicHash &hash) const
{
// Add node ID
hash.addData(id().toUtf8());
}
void Node::InsertInput(const QString &id, NodeValue::Type type, const QVariant &default_value, InputFlags flags, int index)
{
if (id.isEmpty()) {
@@ -1305,11 +1293,6 @@ void Node::IgnoreInvalidationsFrom(const QString& input_id)
ignore_connections_.append(input_id);
}
void Node::IgnoreHashingFrom(const QString &input_id)
{
ignore_when_hashing_.append(input_id);
}
const QString &Node::GetLabel() const
{
return label_;
@@ -1341,24 +1324,6 @@ QString Node::GetLabelOrName() const
return GetLabel();
}
void Node::Hash(QCryptographicHash &hash, const NodeGlobals &globals, const VideoParams &video_params) const
{
// Add this Node's ID and output being used
HashAddNodeSignature(hash);
foreach (const QString& input, inputs()) {
// For each input, try to hash its value
if (ignore_when_hashing_.contains(input)) {
continue;
}
int arr_sz = InputArraySize(input);
for (int i=-1; i<arr_sz; i++) {
HashInputElement(hash, input, i, globals, video_params);
}
}
}
void Node::CopyInputs(const Node *source, Node *destination, bool include_connections)
{
Q_ASSERT(source->id() == destination->id());
@@ -1485,26 +1450,6 @@ QVector<Node *> Node::GetDependenciesInternal(bool traverse, bool exclusive_only
return list;
}
void Node::HashInputElement(QCryptographicHash &hash, const QString& input, int element, const NodeGlobals &globals, const VideoParams& video_params) const
{
// Get time adjustment
// For a single frame, we only care about one of the times
TimeRange input_time = InputTimeAdjustment(input, element, globals.time());
if (IsInputConnected(input, element)) {
// Traverse down this edge
Node *output = GetConnectedOutput(input, element);
NodeGlobals new_globals = globals;
new_globals.set_time(input_time);
Node::Hash(output, GetValueHintForInput(input, element), hash, new_globals, video_params);
} else {
// Grab the value at this time
QVariant value = GetValueAtTime(input, input_time.in(), element);
hash.addData(NodeValue::ValueToBytes(GetInputDataType(input), value));
}
}
QVector<Node *> Node::GetDependencies() const
{
return GetDependenciesInternal(true, false);
@@ -2108,16 +2053,6 @@ void NodeRemovePositionFromAllContextsCommand::undo()
contexts_.clear();
}
void Node::ValueHint::Hash(QCryptographicHash &hash) const
{
// Add value hint
if (!types().isEmpty()) {
hash.addData(reinterpret_cast<const char*>(types().constData()), sizeof(NodeValue::Type) * types().size());
}
hash.addData(reinterpret_cast<const char*>(&index()), sizeof(index()));
hash.addData(tag().toUtf8());
}
void NodeSetPositionAndDependenciesRecursivelyCommand::prepare()
{
move_recursively(node_, pos_.position - context_->GetNodePositionDataInContext(node_).position);