File: undo_delete_multi.cpp

package info (click to toggle)
antimony 0.9.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,476 kB
  • sloc: cpp: 42,596; ansic: 28,661; python: 1,093; yacc: 128; lex: 114; sh: 90; makefile: 10
file content (33 lines) | stat: -rw-r--r-- 885 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <Python.h>

#include "undo/undo_delete_multi.h"
#include "undo/undo_delete_node.h"
#include "undo/undo_delete_datum.h"
#include "undo/undo_delete_link.h"

#include "graph/node.h"

#include <QDebug>
UndoDeleteMulti::UndoDeleteMulti(QSet<Node*> nodes, QSet<Datum*> datums,
                                 QSet<QPair<const Datum*, Datum*>> links)
{
    setText("'delete'");

    for (auto n : nodes)
        for (auto d : n->childDatums())
            for (auto e : d->outgoingLinks())
                links.insert(QPair<Datum*, Datum*>(d, e));

    for (auto d : datums)
        for (auto e : d->outgoingLinks())
            links.insert(QPair<Datum*, Datum*>(d, e));

    for (auto k : links)
        new UndoDeleteLink(k.first, k.second, this);

    for (auto n : nodes)
        new UndoDeleteNode(n, this);

    for (auto d : datums)
        new UndoDeleteDatum(d, this);
}