Пример #1
0
void SCgTupleArranger::startOperation()
{
    // affect changes to bus
    SCgBus *bus = mTupleNode->bus();
    Q_ASSERT(bus != 0);
    SCgBus *ghostBus = qgraphicsitem_cast<SCgBus*>(mGhosts[bus]);
    Q_ASSERT(ghostBus != 0);

    // map points into bus coordinates
    registerCommand(bus, ghostBus->points());

    // affect pairs and objects
    foreach(SCgPair *pair, mBusPairs)
    {
        SCgObject *end = pair->endObject();
        SCgObject *beg = pair->beginObject();
        Q_ASSERT(end != 0 && beg != 0);
        SCgPair *ghostPair = qgraphicsitem_cast<SCgPair*>(mGhosts[pair]);
        Q_ASSERT(ghostPair != 0);

        registerCommand(pair, ghostPair->points());

        if (beg->type() == SCgBus::Type)
            registerCommand(end, mGhosts[end]->pos());
        else
            registerCommand(beg, mGhosts[beg]->pos());
    }
Пример #2
0
void SCgTupleArranger::startOperation()
{
    // affect changes to bus
    SCgBus *bus = mTupleNode->bus();
    Q_ASSERT(bus != 0);
    SCgBus *ghostBus = qgraphicsitem_cast<SCgBus*>(mGhosts[bus]);
    Q_ASSERT(ghostBus != 0);

    registerCommand(bus, ghostBus->points());

    // affect pairs and objects
    foreach(SCgPair *pair, mBusPairs)
    {
        SCgObject *end = pair->getEndObject();
        Q_ASSERT(end != 0);
        SCgObject *ghostEnd = mGhosts[end];
        Q_ASSERT(ghostEnd != 0);
        SCgPair *ghostPair = qgraphicsitem_cast<SCgPair*>(mGhosts[pair]);
        Q_ASSERT(ghostPair != 0);

        registerCommand(pair, ghostPair->points());
        registerCommand(end, ghostEnd->pos());
    }