node: removed slow unrecommended functions
This commit is contained in:
@@ -1555,64 +1555,6 @@ void Node::GenerateFrame(FramePtr frame, const GenerateJob &job) const
|
||||
Q_UNUSED(job)
|
||||
}
|
||||
|
||||
bool Node::OutputsTo(Node *n, bool recursively, const OutputConnections &ignore_edges, const OutputConnection &added_edge) const
|
||||
{
|
||||
for (const OutputConnection& conn : output_connections_) {
|
||||
if (std::find(ignore_edges.cbegin(), ignore_edges.cend(), conn) != ignore_edges.cend()) {
|
||||
// If this edge is in the "ignore edges" list, skip it
|
||||
continue;
|
||||
}
|
||||
|
||||
Node* connected = conn.second.node();
|
||||
|
||||
if (connected == n) {
|
||||
return true;
|
||||
} else if (recursively && connected->OutputsTo(n, recursively, ignore_edges, added_edge)) {
|
||||
return true;
|
||||
} else if (added_edge.first == this) {
|
||||
Node *proposed_connected = added_edge.second.node();
|
||||
|
||||
if (proposed_connected == n) {
|
||||
return true;
|
||||
} else if (recursively && proposed_connected->OutputsTo(n, recursively, ignore_edges, added_edge)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Node::OutputsTo(const QString &id, bool recursively) const
|
||||
{
|
||||
for (const OutputConnection& conn : output_connections_) {
|
||||
Node* connected = conn.second.node();
|
||||
|
||||
if (connected->id() == id) {
|
||||
return true;
|
||||
} else if (recursively && connected->OutputsTo(id, recursively)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Node::OutputsTo(const NodeInput &input, bool recursively) const
|
||||
{
|
||||
for (const OutputConnection& conn : output_connections_) {
|
||||
const NodeInput& connected = conn.second;
|
||||
|
||||
if (connected == input) {
|
||||
return true;
|
||||
} else if (recursively && connected.node()->OutputsTo(input, recursively)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Node::InputsFrom(Node *n, bool recursively) const
|
||||
{
|
||||
for (auto it=input_connections_.cbegin(); it!=input_connections_.cend(); it++) {
|
||||
@@ -1643,28 +1585,6 @@ bool Node::InputsFrom(const QString &id, bool recursively) const
|
||||
return false;
|
||||
}
|
||||
|
||||
int Node::GetNumberOfRoutesTo(Node *n) const
|
||||
{
|
||||
bool outputs_directly = false;
|
||||
int routes = 0;
|
||||
|
||||
foreach (const OutputConnection& conn, output_connections_) {
|
||||
Node* connected_node = conn.second.node();
|
||||
|
||||
if (connected_node == n) {
|
||||
outputs_directly = true;
|
||||
} else {
|
||||
routes += connected_node->GetNumberOfRoutesTo(n);
|
||||
}
|
||||
}
|
||||
|
||||
if (outputs_directly) {
|
||||
routes++;
|
||||
}
|
||||
|
||||
return routes;
|
||||
}
|
||||
|
||||
void Node::DisconnectAll()
|
||||
{
|
||||
// Disconnect inputs (copy map since internal map will change as we disconnect)
|
||||
|
||||
@@ -786,30 +786,6 @@ public:
|
||||
*/
|
||||
virtual void GenerateFrame(FramePtr frame, const GenerateJob &job) const;
|
||||
|
||||
/**
|
||||
* @brief Returns whether this Node outputs to `n`
|
||||
*
|
||||
* @param n
|
||||
*
|
||||
* The node instance to check.
|
||||
*
|
||||
* @param recursively
|
||||
*
|
||||
* Whether to keep traversing down outputs to find this node (TRUE) or stick to immediate outputs
|
||||
* (FALSE).
|
||||
*/
|
||||
bool OutputsTo(Node* n, bool recursively, const OutputConnections &ignore_edges = OutputConnections(), const OutputConnection &added_edge = OutputConnection()) const;
|
||||
|
||||
/**
|
||||
* @brief Same as OutputsTo(Node*), but for a node ID rather than a specific instance.
|
||||
*/
|
||||
bool OutputsTo(const QString& id, bool recursively) const;
|
||||
|
||||
/**
|
||||
* @brief Same as OutputsTo(Node*), but for a specific node input rather than just a node.
|
||||
*/
|
||||
bool OutputsTo(const NodeInput &input, bool recursively) const;
|
||||
|
||||
/**
|
||||
* @brief Returns whether this node ever receives an input from a particular node instance
|
||||
*/
|
||||
@@ -820,7 +796,6 @@ public:
|
||||
*/
|
||||
bool InputsFrom(const QString& id, bool recursively) const;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Find inputs that `output` outputs to in order to arrive at this node
|
||||
*
|
||||
@@ -829,11 +804,6 @@ public:
|
||||
*/
|
||||
QVector<NodeInput> FindWaysNodeArrivesHere(const Node *output) const;
|
||||
|
||||
/**
|
||||
* @brief Determines how many paths go from this node out to another node
|
||||
*/
|
||||
int GetNumberOfRoutesTo(Node* n) const;
|
||||
|
||||
/**
|
||||
* @brief Severs all input and output connections
|
||||
*/
|
||||
@@ -866,12 +836,6 @@ public:
|
||||
template<class T>
|
||||
static QVector<T*> FindInputNodesConnectedToInput(const NodeInput &input, int maximum = 0);
|
||||
|
||||
template<class T>
|
||||
/**
|
||||
* @brief Find a node of a certain type that this Node outputs to
|
||||
*/
|
||||
QVector<T *> FindOutputNode();
|
||||
|
||||
/**
|
||||
* @brief Convert a pointer to a value that can be sent between NodeParams
|
||||
*/
|
||||
@@ -1413,9 +1377,6 @@ private:
|
||||
template<class T>
|
||||
static void FindInputNodeInternal(const Node* n, QVector<T *>& list, int maximum);
|
||||
|
||||
template<class T>
|
||||
static void FindOutputNodeInternal(const Node* n, QVector<T *>& list);
|
||||
|
||||
QVector<Node*> GetDependenciesInternal(bool traverse, bool exclusive_only) const;
|
||||
|
||||
void ParameterValueChanged(const QString &input, int element, const olive::TimeRange &range);
|
||||
@@ -1573,31 +1534,6 @@ T* Node::ValueToPtr(const QVariant &ptr)
|
||||
return reinterpret_cast<T*>(ptr.value<quintptr>());
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void Node::FindOutputNodeInternal(const Node* n, QVector<T *>& list)
|
||||
{
|
||||
foreach (const OutputConnection& output, n->output_connections_) {
|
||||
Node* connected = output.second.node();
|
||||
T* cast_test = dynamic_cast<T*>(connected);
|
||||
|
||||
if (cast_test) {
|
||||
list.append(cast_test);
|
||||
}
|
||||
|
||||
FindOutputNodeInternal<T>(connected, list);
|
||||
}
|
||||
}
|
||||
|
||||
template<class T>
|
||||
QVector<T *> Node::FindOutputNode()
|
||||
{
|
||||
QVector<T *> list;
|
||||
|
||||
FindOutputNodeInternal<T>(this, list);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
using NodePtr = std::shared_ptr<Node>;
|
||||
|
||||
class NodeSetPositionCommand : public UndoCommand
|
||||
|
||||
Reference in New Issue
Block a user