void ChromaMatteNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context) { InputSocket *inputSocketImage = this->getInputSocket(0); InputSocket *inputSocketKey = this->getInputSocket(1); OutputSocket *outputSocketImage = this->getOutputSocket(0); OutputSocket *outputSocketMatte = this->getOutputSocket(1); ConvertRGBToYCCOperation *operationRGBToYCC_Image = new ConvertRGBToYCCOperation(); ConvertRGBToYCCOperation *operationRGBToYCC_Key = new ConvertRGBToYCCOperation(); operationRGBToYCC_Image->setMode(0); /* BLI_YCC_ITU_BT601 */ operationRGBToYCC_Key->setMode(0); /* BLI_YCC_ITU_BT601 */ ChromaMatteOperation *operation = new ChromaMatteOperation(); bNode *editorsnode = getbNode(); operation->setSettings((NodeChroma *)editorsnode->storage); inputSocketImage->relinkConnections(operationRGBToYCC_Image->getInputSocket(0), 0, graph); inputSocketKey->relinkConnections(operationRGBToYCC_Key->getInputSocket(0), 0, graph); addLink(graph, operationRGBToYCC_Image->getOutputSocket(), operation->getInputSocket(0)); addLink(graph, operationRGBToYCC_Key->getOutputSocket(), operation->getInputSocket(1)); graph->addOperation(operationRGBToYCC_Image); graph->addOperation(operationRGBToYCC_Key); graph->addOperation(operation); if (outputSocketMatte->isConnected()) { outputSocketMatte->relinkConnections(operation->getOutputSocket()); } SetAlphaOperation *operationAlpha = new SetAlphaOperation(); addLink(graph, operationRGBToYCC_Image->getInputSocket(0)->getConnection()->getFromSocket(), operationAlpha->getInputSocket(0)); addLink(graph, operation->getOutputSocket(), operationAlpha->getInputSocket(1)); graph->addOperation(operationAlpha); addPreviewOperation(graph, context, operationAlpha->getOutputSocket()); if (outputSocketImage->isConnected()) { outputSocketImage->relinkConnections(operationAlpha->getOutputSocket()); } }
OutputSocket *KeyingNode::setupFeather(ExecutionSystem *graph, CompositorContext *context, OutputSocket *featherInput, int falloff, int distance) { /* this uses a modified gaussian blur function otherwise its far too slow */ CompositorQuality quality = context->getQuality(); /* initialize node data */ NodeBlurData *data = &this->m_alpha_blur; memset(data, 0, sizeof(*data)); data->filtertype = R_FILTER_GAUSS; if (distance > 0) { data->sizex = data->sizey = distance; } else { data->sizex = data->sizey = -distance; } GaussianAlphaXBlurOperation *operationx = new GaussianAlphaXBlurOperation(); operationx->setData(data); operationx->setQuality(quality); operationx->setSize(1.0f); operationx->setSubtract(distance < 0); operationx->setFalloff(falloff); operationx->setbNode(this->getbNode()); graph->addOperation(operationx); GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation(); operationy->setData(data); operationy->setQuality(quality); operationy->setSize(1.0f); operationy->setSubtract(distance < 0); operationy->setFalloff(falloff); operationy->setbNode(this->getbNode()); graph->addOperation(operationy); addLink(graph, featherInput, operationx->getInputSocket(0)); addLink(graph, operationx->getOutputSocket(), operationy->getInputSocket(0)); return operationy->getOutputSocket(); }
OutputSocket *KeyingNode::setupPostBlur(ExecutionSystem *graph, OutputSocket *postBlurInput, int size) { KeyingBlurOperation *blurXOperation = new KeyingBlurOperation(); KeyingBlurOperation *blurYOperation = new KeyingBlurOperation(); blurXOperation->setSize(size); blurXOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_X); blurXOperation->setbNode(this->getbNode()); blurYOperation->setSize(size); blurYOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_Y); blurYOperation->setbNode(this->getbNode()); addLink(graph, postBlurInput, blurXOperation->getInputSocket(0)); addLink(graph, blurXOperation->getOutputSocket(), blurYOperation->getInputSocket(0)); graph->addOperation(blurXOperation); graph->addOperation(blurYOperation); return blurYOperation->getOutputSocket(); }
BaseData::BaseData( const BaseInitData& init) : help(init.helpMsg), ownerClass(init.ownerClass), group(init.group), widget(init.widget) , m_counters(), m_isSets(), m_dataFlags(init.dataFlags) , m_owner(init.owner), m_name(init.name) , parentBaseData(initLink("parent", "Linked Data, from which values are automatically copied")) { addLink(&inputs); addLink(&outputs); m_counters.assign(0); m_isSets.assign(false); if (init.data && init.data != this) { std::cerr << "CODE ERROR: initData POINTER MISMATCH: field name \"" << init.name << "\""; if (init.owner) std::cerr << " created by class " << init.owner->getClassName(); std::cerr << "!...aborting" << std::endl; sofa::helper::BackTrace::dump(); exit( 1 ); } //setAutoLink(true); if (m_owner) m_owner->addData(this, m_name); }
virtual void parseLinks(QDomNodeList & links) { for ( uint i = 0; i < links.length(); i++) { QDomElement link = links.item(i).toElement(); uint idFrom = link.attribute("from").toUInt(); uint idTo = link.attribute("to").toUInt(); uint capacity = link.attribute("capacity").toUInt(); Link * alink = new Link(QString("%1_%2").arg(idFrom).arg(idTo).toStdString(), capacity, capacity); addLink(idFrom, idTo, alink); linkXMLCache[alink] = link; } }
void CDirectLink::addLink(Cconnector *A, Cconnector *B, bool close) { addlinkMutex.lock(); if (close) { AConnList.append(A); BConnList.append(B); closeList.append(close); } else { // Create a link object #if 1 AConnList.append(A); BConnList.append(B); closeList.append(close); #ifdef AVOID Avoid::ConnEnd srcEnd(mainwindow->shapeRefList[A->Parent],A->Id+1); Avoid::ConnEnd dstEnd(mainwindow->shapeRefList[B->Parent],B->Id+1); new Avoid::ConnRef(mainwindow->router, srcEnd, dstEnd); mainwindow->router->processTransaction(); mainwindow->router->outputInstanceToSVG("test-connectionpin01"); #endif #else // 1 - create the CCable object Ccable *pPC = (Ccable*)mainwindow->LoadPocket(CABLE11Pins); // 2 - define its size and position bool reverse = pPC->Adapt(A,B); pPC->standard = true; addLink(A,pPC->ConnList.at(reverse?1:0),true); pPC->ConnList.at(reverse?1:0)->setOppDir(A->getDir()); addLink(pPC->ConnList.at(reverse?0:1),B,true); pPC->ConnList.at(reverse?0:1)->setOppDir(B->getDir()); #endif } addlinkMutex.unlock(); emit A->linked(); emit B->linked(); }
void NodeOperationBuilder::add_input_buffers(NodeOperation * /*operation*/, NodeOperationInput *input) { if (!input->isConnected()) return; NodeOperationOutput *output = input->getLink(); if (output->getOperation().isReadBufferOperation()) { /* input is already buffered, no need to add another */ return; } /* this link will be replaced below */ removeInputLink(input); /* check of other end already has write operation, otherwise add a new one */ WriteBufferOperation *writeoperation = find_attached_write_buffer_operation(output); if (!writeoperation) { writeoperation = new WriteBufferOperation(output->getDataType()); writeoperation->setbNodeTree(m_context->getbNodeTree()); addOperation(writeoperation); addLink(output, writeoperation->getInputSocket(0)); writeoperation->readResolutionFromInputSocket(); } /* add readbuffer op for the input */ ReadBufferOperation *readoperation = new ReadBufferOperation(output->getDataType()); readoperation->setMemoryProxy(writeoperation->getMemoryProxy()); this->addOperation(readoperation); addLink(readoperation->getOutputSocket(), input); readoperation->readResolutionFromWriteBuffer(); }
void CombineYCCANode::convertToOperations(ExecutionSystem *graph, CompositorContext *context) { ConvertYCCToRGBOperation *operation = new ConvertYCCToRGBOperation(); OutputSocket *outputSocket = this->getOutputSocket(0); bNode *node = this->getbNode(); operation->setMode(node->custom1); if (outputSocket->isConnected()) { outputSocket->relinkConnections(operation->getOutputSocket()); addLink(graph, outputSocket, operation->getInputSocket(0)); } graph->addOperation(operation); CombineRGBANode::convertToOperations(graph, context); }
void Topology::make2DTorus(Vector<SwitchID> network_in_switches, Vector<SwitchID> network_out_switches) { int lengthOfSide = (int)sqrt((double)m_nodes); Vector<SwitchID> torusSwitches; for(int i=0; i<m_nodes; i++){ SwitchID new_switch = newSwitchID(); torusSwitches.insertAtBottom(new_switch); } for(int i=0; i<m_nodes; i++){ SwitchID new_switch = torusSwitches[i]; // add links between switch and node SwitchID port_into_network = network_in_switches[i]; SwitchID port_from_network = network_out_switches[i]; addLink(port_into_network, new_switch, g_param_ptr->NETWORK_LINK_LATENCY()); // Latency of 1 because we're not crossing a chip boundary (on-chip switch to processor) // Bandwidth multiplier of 10 so this on-chip link to the processor isn't the bandwidth bottleneck addLink(new_switch, port_from_network, 1, 10); // left SwitchID leftNeighbor; if(new_switch%lengthOfSide == 0){ leftNeighbor = new_switch - 1 + lengthOfSide; } else { leftNeighbor = new_switch - 1; } addLink(new_switch, leftNeighbor, g_param_ptr->NETWORK_LINK_LATENCY()); // right SwitchID rightNeighbor; if((new_switch + 1)%lengthOfSide == 0){ rightNeighbor = new_switch + 1 - lengthOfSide; } else { rightNeighbor = new_switch + 1; } addLink(new_switch, rightNeighbor, g_param_ptr->NETWORK_LINK_LATENCY()); // top SwitchID topNeighbor; if(new_switch - lengthOfSide < 2*m_nodes){ topNeighbor = new_switch - lengthOfSide + (lengthOfSide*lengthOfSide); } else { topNeighbor = new_switch - lengthOfSide; } addLink(new_switch, topNeighbor, g_param_ptr->NETWORK_LINK_LATENCY()); // bottom SwitchID bottomNeighbor; if(new_switch + lengthOfSide >= 3*m_nodes){ // sorin: bad bug if this is a > instead of a >= bottomNeighbor = new_switch + lengthOfSide - (lengthOfSide*lengthOfSide); } else { bottomNeighbor = new_switch + lengthOfSide; } addLink(new_switch, bottomNeighbor, g_param_ptr->NETWORK_LINK_LATENCY()); } }
SocketConnection *ExecutionSystemHelper::addNodeLink(NodeRange &node_range, vector<SocketConnection *>& links, bNodeLink *b_nodelink) { /// @note: ignore invalid links if (!(b_nodelink->flag & NODE_LINK_VALID)) return NULL; InputSocket *inputSocket = find_input(node_range, b_nodelink->tonode, b_nodelink->tosock); OutputSocket *outputSocket = find_output(node_range, b_nodelink->fromnode, b_nodelink->fromsock); if (inputSocket == NULL || outputSocket == NULL) { return NULL; } if (inputSocket->isConnected()) { return NULL; } SocketConnection *connection = addLink(links, outputSocket, inputSocket); return connection; }
Structure::Graph::Graph(Graph& other) { this->mID = other.mID; for (Node* n : other.nodes) addNode(n->clone()); for (Link* l : other.links) { Link* l_copy = l->clone(); addLink(l_copy); l_copy->node1 = getNode(l->nid1); l_copy->node2 = getNode(l->nid2); } properties = other.properties; }
void ApplicationCore::updateTaskList() { #ifdef Q_OS_WIN const auto recentData = DATAMODEL->mostRecentlyUsedTasks(); auto recentJumpList = m_windowsJumpList->recent(); recentJumpList->clear(); int count = 0; Q_FOREACH (const auto &id, recentData) { if (count++ > 5) break; recentJumpList->addLink(Data::goIcon(), DATAMODEL->getTask( id).name(), qApp->applicationFilePath(), { QLatin1String("--start-task"), QString::number(id) }); } recentJumpList->setVisible(true); #endif }
bool DAGraph::addBetterLinks(){ bool wasImproved = false; bool newLinkAdded = false; p2Cont_.clear(); for (int linkIndex = getNextNotInSet(-1); linkIndex != -1; linkIndex = getNextNotInSet(linkIndex)) { StarLink *link = net_->getLink(linkIndex); if (isReachable(link) && worthAdding(link)) { if (addLink(link)) newLinkAdded = true; wasImproved = true; } } if (!wasImproved) { newLinkAdded = addFromP2(); } return newLinkAdded; };
OutputSocket *KeyingNode::setupClip(ExecutionSystem *graph, OutputSocket *clipInput, int kernelRadius, float kernelTolerance, float clipBlack, float clipWhite, bool edgeMatte) { KeyingClipOperation *clipOperation = new KeyingClipOperation(); clipOperation->setKernelRadius(kernelRadius); clipOperation->setKernelTolerance(kernelTolerance); clipOperation->setClipBlack(clipBlack); clipOperation->setClipWhite(clipWhite); clipOperation->setIsEdgeMatte(edgeMatte); addLink(graph, clipInput, clipOperation->getInputSocket(0)); graph->addOperation(clipOperation); return clipOperation->getOutputSocket(0); }
void LanLinkProvider::encrypted() { qCDebug(KDECONNECT_CORE) << "Socket succesfully stablished an SSL connection"; QSslSocket* socket = qobject_cast<QSslSocket*>(sender()); if (!socket) return; disconnect(socket, SIGNAL(encrypted()), this, SLOT(encrypted())); disconnect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(sslErrors(QList<QSslError>))); NetworkPackage* receivedPackage = receivedIdentityPackages[socket].np; const QString& deviceId = receivedPackage->get<QString>("deviceId"); //qCDebug(KDECONNECT_CORE) << "Connected" << socket->isWritable(); addLink(deviceId, socket, receivedPackage, LanDeviceLink::Remotely); // Copied from connected slot, now delete received package delete receivedIdentityPackages.take(socket).np; }
void PersonView::slotLinkClicked( const QUrl &url ) { qDebug() << "CLICKED" << url; if ( url.scheme() == "polka" ) { QStringList path = url.path().split("/"); QString action = path.first(); qDebug() << "ACTION" << action; if ( action == "editName" ) editName(); else if ( action == "addEmail" ) addEmail(); else if ( action == "editEmail" ) editEmail( path.value( 1 ) ); else if ( action == "removeEmail" ) removeEmail( path.value( 1 ) ); else if ( action == "commentEmail" ) commentEmail( path.value( 1 ) ); else if ( action == "addPhone" ) addPhone(); else if ( action == "editPhone" ) editPhone( path.value( 1 ) ); else if ( action == "removePhone" ) removePhone( path.value( 1 ) ); else if ( action == "commentPhone" ) commentPhone( path.value( 1 ) ); else if ( action == "addLink" ) addLink(); else if ( action == "editLink" ) editLink( path.value( 1 ) ); else if ( action == "removeLink" ) removeLink( path.value( 1 ) ); else if ( action == "commentLink" ) commentLink( path.value( 1 ) ); else if ( action == "addAddress" ) addAddress(); else if ( action == "editAddress" ) editAddress( path.value( 1 ) ); else if ( action == "removeAddress" ) removeAddress( path.value( 1 ) ); else if ( action == "commentAddress" ) commentAddress( path.value( 1 ) ); else if ( action == "addComment" ) addComment(); else if ( action == "editComment" ) editComment( path.value( 1 ) ); else if ( action == "removeComment" ) removeComment( path.value( 1 ) ); else if ( action == "close" ) requestClose(); else if ( action == "magic" ) debugHtml(); else qDebug() << "unknown action" << action; } else { new KRun( QUrl( url ), this ); } }
void FSM::VM<X>::createStates(std::istream &stream) { boost::regex state("state: *([a-zA-Z][a-zA-Z0-9_-]*)"); boost::regex transit("transit: *\\[([A-Z]+)] *-> *([a-zA-Z][a-zA-Z0-9_-]*)"); boost::regex link("([a-zA-Z][a-zA-Z0-9_-]*) *\\[([A-Z]+)] *-> *([a-zA-Z][a-zA-Z0-9_-]*)"); std::string line; while (std::getline(stream, line)) { boost::match_results<std::string::iterator> what; #ifdef DEBUG std::cout << "line: " << line << std::endl; #endif if (boost::regex_search(line.begin(), line.end(), what, state, boost::regex_constants::match_default)) { #ifdef DEBUG std::cout << "MATCHED with " << state.expression() << std::endl; std::cout << "Extracted: " << what[1] << std::endl; #endif addState(what[1]); } else if (boost::regex_search(line.begin(), line.end(), what, link, boost::regex_constants::match_default)) { #ifdef DEBUG std::cout << "MATCHED with " << link.expression() << std::endl; std::cout << "Extracted: " << what[1] << " && " << what[2] << " && " << what[3] << std::endl; #endif addLink(what[1], what[2], what[3]); } else if (boost::regex_search(line.begin(), line.end(), what, transit, boost::regex_constants::match_default)) { } #ifdef DEBUG else std::cout << "DID NOT MATCHED" << std::endl; #endif } }
OutputSocket *KeyingNode::setupPreBlur(ExecutionSystem *graph, InputSocket *inputImage, int size, OutputSocket **originalImage) { ConvertRGBToYCCOperation *convertRGBToYCCOperation = new ConvertRGBToYCCOperation(); convertRGBToYCCOperation->setMode(0); /* ITU 601 */ inputImage->relinkConnections(convertRGBToYCCOperation->getInputSocket(0), 0, graph); graph->addOperation(convertRGBToYCCOperation); CombineChannelsOperation *combineOperation = new CombineChannelsOperation(); graph->addOperation(combineOperation); for (int channel = 0; channel < 4; channel++) { SeparateChannelOperation *separateOperation = new SeparateChannelOperation(); separateOperation->setChannel(channel); addLink(graph, convertRGBToYCCOperation->getOutputSocket(0), separateOperation->getInputSocket(0)); graph->addOperation(separateOperation); if (channel == 0 || channel == 3) { addLink(graph, separateOperation->getOutputSocket(0), combineOperation->getInputSocket(channel)); } else { KeyingBlurOperation *blurXOperation = new KeyingBlurOperation(); KeyingBlurOperation *blurYOperation = new KeyingBlurOperation(); blurXOperation->setSize(size); blurXOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_X); blurXOperation->setbNode(this->getbNode()); blurYOperation->setSize(size); blurYOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_Y); blurYOperation->setbNode(this->getbNode()); addLink(graph, separateOperation->getOutputSocket(), blurXOperation->getInputSocket(0)); addLink(graph, blurXOperation->getOutputSocket(), blurYOperation->getInputSocket(0)); addLink(graph, blurYOperation->getOutputSocket(0), combineOperation->getInputSocket(channel)); graph->addOperation(blurXOperation); graph->addOperation(blurYOperation); } } ConvertYCCToRGBOperation *convertYCCToRGBOperation = new ConvertYCCToRGBOperation(); convertYCCToRGBOperation->setMode(0); /* ITU 601 */ addLink(graph, combineOperation->getOutputSocket(0), convertYCCToRGBOperation->getInputSocket(0)); graph->addOperation(convertYCCToRGBOperation); *originalImage = convertRGBToYCCOperation->getInputSocket(0)->getConnection()->getFromSocket(); return convertYCCToRGBOperation->getOutputSocket(0); }
/** * add content with autolink */ void ChatOutput::addContent(const QString &content, const QTextCharFormat &format) { QString text; QString url; int offset = 0; int index = autolinkRegexp.indexIn(content, offset); // avoid QString::mid call, content does not have links most cases. if (index == -1) { Q_ASSERT(offset == 0); addText(content, format); return; } do { Q_ASSERT(index == -1 || index >= 0); // add normal text. // when index was -1, no more links, that add the rest of content. text = content.mid(offset, (index == -1) ? -1 : (index-offset)); if (!text.isEmpty()) { addText(text, format); } if (index == -1) { break; } url = autolinkRegexp.cap(0); if (!url.isEmpty()) { addLink(url, url); } // set variables for next iteration. offset = index + autolinkRegexp.matchedLength(); index = autolinkRegexp.indexIn(content, offset); // NOTE: overflow check ((int + int) >= 0) Q_ASSERT(offset >= 0); } while (offset >= 0); }
void IDMaskNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context) { bNode *bnode = this->getbNode(); IDMaskOperation *operation; operation = new IDMaskOperation(); operation->setObjectIndex(bnode->custom1); this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); if (bnode->custom2 == 0 || context->getRenderData()->scemode & R_FULL_SAMPLE) { this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0)); } else { AntiAliasOperation *antiAliasOperation = new AntiAliasOperation(); addLink(graph, operation->getOutputSocket(), antiAliasOperation->getInputSocket(0)); this->getOutputSocket(0)->relinkConnections(antiAliasOperation->getOutputSocket(0)); graph->addOperation(antiAliasOperation); } graph->addOperation(operation); }
int main() { int n, i, a; DEHead *head = malloc(sizeof(DEHead)); head->front = head->tail = NULL; head->cnt = 0; while (EOF != scanf("%d", &n) && n > 0) { for (i = 0; i < n; ++i) { scanf("%d", &a); // printf("add %d\n", a); addLink(head, a); } } PrintDELink(head); DELinkSort(head); PrintDELink(head); DeleteDELLink(head); return 0; }
void LanLinkProvider::encrypted() { qCDebug(KDECONNECT_CORE) << "Socket succesfully stablished an SSL connection"; QSslSocket* socket = qobject_cast<QSslSocket*>(sender()); if (!socket) return; disconnect(socket, &QSslSocket::encrypted, this, &LanLinkProvider::encrypted); disconnect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(sslErrors(QList<QSslError>))); Q_ASSERT(socket->mode() != QSslSocket::UnencryptedMode); LanDeviceLink::ConnectionStarted connectionOrigin = (socket->mode() == QSslSocket::SslClientMode)? LanDeviceLink::Locally : LanDeviceLink::Remotely; NetworkPackage* receivedPackage = receivedIdentityPackages[socket].np; const QString& deviceId = receivedPackage->get<QString>(QStringLiteral("deviceId")); addLink(deviceId, socket, receivedPackage, connectionOrigin); // Copied from connected slot, now delete received package delete receivedIdentityPackages.take(socket).np; }
OutputSocket *KeyingNode::setupDilateErode(ExecutionSystem *graph, OutputSocket *dilateErodeInput, int distance) { DilateDistanceOperation *dilateErodeOperation; if (distance > 0) { dilateErodeOperation = new DilateDistanceOperation(); dilateErodeOperation->setDistance(distance); } else { dilateErodeOperation = new ErodeDistanceOperation(); dilateErodeOperation->setDistance(-distance); } dilateErodeOperation->setbNode(this->getbNode()); addLink(graph, dilateErodeInput, dilateErodeOperation->getInputSocket(0)); graph->addOperation(dilateErodeOperation); return dilateErodeOperation->getOutputSocket(0); }
GGEditContentMappingDialog::GGEditContentMappingDialog(GGEditModel *model, QWidget *parent) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint), ui(new Ui::GGEditContentMappingDialog), m_page(NULL), m_windowInfo(this, "MappingEditor") { ui->setupUi(this); m_windowInfo.addSplitter(ui->splitter); m_windowInfo.restore(); m_scene = new GGMappingScene(this); ui->graphicsView->setScene(m_scene); m_ctrl = new GGMappingUIController(model, this); ui->actionUndo->setShortcut(QKeySequence::Undo); ui->actionRedo->setShortcut(QKeySequence::Redo); ui->actionDelete->setShortcut(QKeySequence::Delete); this->addAction(ui->actionUndo); this->addAction(ui->actionRedo); ui->graphicsView->addAction(ui->actionDelete); ui->wgtLinks->setFields(GGConnectionEditorWidget::Action | GGConnectionEditorWidget::Caption | GGConnectionEditorWidget::Page | GGConnectionEditorWidget::Number); ui->wgtLinks->setActions(GGConnectionEditorWidget::Edit | GGConnectionEditorWidget::Delete | GGConnectionEditorWidget::Hover); connect(ui->actionUndo, SIGNAL(triggered(bool)), m_ctrl, SLOT(undo())); connect(ui->actionRedo, SIGNAL(triggered(bool)), m_ctrl, SLOT(redo())); connect(ui->actionDelete, SIGNAL(triggered(bool)), this, SLOT(deleteSelectedItem())); connect(model, SIGNAL(pageUpdated(GGPage*,GGAbstractModel::PageSections)), this, SLOT(updatePage(GGPage*))); connect(m_scene, SIGNAL(addedItem(QRect)), this, SLOT(addLink(QRect))); connect(m_scene, SIGNAL(movedItem(int,QRect)), this, SLOT(moveLink(int,QRect))); connect(ui->wgtLinks, SIGNAL(hoverEnteredConnection(GGPage*,GGConnectionSlot)), this, SLOT(handleHoverEnter(GGPage*,GGConnectionSlot))); connect(ui->wgtLinks, SIGNAL(hoverLeftConnection(GGPage*,GGConnectionSlot)), this, SLOT(handleHoverLeave(GGPage*,GGConnectionSlot))); connect(ui->wgtLinks, SIGNAL(updateLinkCaption(GGPage*,GGConnectionSlot,QString)), this, SLOT(updateLinkCaption(GGPage*,GGConnectionSlot,QString))); connect(ui->wgtLinks, SIGNAL(updateLinkAction(GGPage*,GGConnectionSlot,GGAction)), this, SLOT(updateLinkAction(GGPage*,GGConnectionSlot,GGAction))); connect(ui->wgtLinks, SIGNAL(deleteConnection(GGPage*,GGConnectionSlot)), this, SLOT(deleteConnect(GGPage*,GGConnectionSlot))); }
Device::Device(QObject* parent, const NetworkPackage& identityPackage, DeviceLink* dl) : QObject(parent) , m_deviceId(identityPackage.get<QString>("deviceId")) , m_deviceName(identityPackage.get<QString>("deviceName")) , m_deviceType(str2type(identityPackage.get<QString>("deviceType"))) , m_pairStatus(Device::NotPaired) , m_protocolVersion(identityPackage.get<int>("protocolVersion", -1)) { addLink(identityPackage, dl); //Register in bus QDBusConnection::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportAdaptors); //Implement deprecated signals connect(this, &Device::pairingChanged, this, [this](bool newPairing) { if (newPairing) Q_EMIT pairingSuccesful(); else Q_EMIT unpaired(); }); }
void URDFProperty::on_treeWidget_customContextMenuRequested(const QPoint &pos) { QTreeWidgetItem *sel = tree_widget_->selectedItems()[0]; QMenu *menu = new QMenu(tree_widget_.get()); menu->addAction("Add"); menu->addAction("Remove"); QAction *selected_item = menu->exec(tree_widget_->mapToGlobal(pos)); if (selected_item) { if (selected_item->text() == "Add") { if (sel == link_root_ || sel->parent() == link_root_) { addLink(); } else if (sel == joint_root_ || isJoint(sel)) { addJoint(sel); } } else { if (sel->parent() == link_root_) { link_names_.removeOne(sel->text(0)); link_root_->removeChild(sel); } else if (isJoint(sel)) { joint_names_.removeOne(sel->text(0)); sel->parent()->removeChild(sel); } } } delete menu; }
void DiagramWindow::createActions() { exitAction = new QAction(tr("E&xit"), this); exitAction->setShortcut(tr("Ctrl+Q")); connect(exitAction, SIGNAL(triggered()), this, SLOT(close())); addNodeAction = new QAction(QIcon(":/images/node.png"), tr("Add &Node"), this); addNodeAction->setShortcut(QKeySequence::New); connect(addNodeAction, SIGNAL(triggered()), this, SLOT(addNode())); addLinkAction = new QAction(QIcon(":/images/link.png"), tr("Add &Link"), this); addLinkAction->setShortcut(tr("Ctrl+L")); connect(addLinkAction, SIGNAL(triggered()), this, SLOT(addLink())); deleteAction = new QAction(QIcon(":/images/delete.png"), tr("&Delete"), this); deleteAction->setShortcut(tr("Del")); connect(deleteAction, SIGNAL(triggered()), this, SLOT(del())); cutAction = new QAction(QIcon(":/images/cut.png"), tr("Cu&t"), this); cutAction->setShortcut(QKeySequence::Cut); connect(cutAction, SIGNAL(triggered()), this, SLOT(cut())); copyAction = new QAction(QIcon(":/images/copy.png"), tr("&Copy"), this); copyAction->setShortcut(QKeySequence::Copy); connect(copyAction, SIGNAL(triggered()), this, SLOT(copy())); pasteAction = new QAction(QIcon(":/images/paste.png"), tr("&Paste"), this); pasteAction->setShortcut(QKeySequence::Paste); connect(pasteAction, SIGNAL(triggered()), this, SLOT(paste())); bringToFrontAction = new QAction(QIcon(":/images/bringtofront.png"), tr("Bring to &Front"), this); connect(bringToFrontAction, SIGNAL(triggered()), this, SLOT(bringToFront())); sendToBackAction = new QAction(QIcon(":/images/sendtoback.png"), tr("&Send to Back"), this); connect(sendToBackAction, SIGNAL(triggered()), this, SLOT(sendToBack())); propertiesAction = new QAction(tr("P&roperties..."),this); connect(propertiesAction, SIGNAL(triggered()), this, SLOT(properties())); }
void CornerPinNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context) { InputSocket *input_image = this->getInputSocket(0); /* note: socket order differs between UI node and operations: * bNode uses intuitive order following top-down layout: * upper-left, upper-right, lower-left, lower-right * Operations use same order as the tracking blenkernel functions expect: * lower-left, lower-right, upper-right, upper-left */ const int node_corner_index[4] = { 3, 4, 2, 1 }; OutputSocket *output_warped_image = this->getOutputSocket(0); OutputSocket *output_plane = this->getOutputSocket(1); PlaneCornerPinWarpImageOperation *warp_image_operation = new PlaneCornerPinWarpImageOperation(); input_image->relinkConnections(warp_image_operation->getInputSocket(0), 0, graph); for (int i = 0; i < 4; ++i) { int node_index = node_corner_index[i]; getInputSocket(node_index)->relinkConnections(warp_image_operation->getInputSocket(i + 1), node_index, graph); } output_warped_image->relinkConnections(warp_image_operation->getOutputSocket()); graph->addOperation(warp_image_operation); PlaneCornerPinMaskOperation *plane_mask_operation = new PlaneCornerPinMaskOperation(); /* connect mask op inputs to the same sockets as the warp image op */ for (int i = 0; i < 4; ++i) addLink(graph, warp_image_operation->getInputSocket(i + 1)->getConnection()->getFromSocket(), plane_mask_operation->getInputSocket(i)); output_plane->relinkConnections(plane_mask_operation->getOutputSocket()); graph->addOperation(plane_mask_operation); }
void AddEditLink::slotButtonClicked( int button ) { if(button == KDialog::Ok) { QString link = ui.txtAddress->currentText(); if ( link.isEmpty() ) return; QString linkTarget; if ( ui.comboTarget->currentIndex() == 1 ) { linkTarget = "_self"; } else if ( ui.comboTarget->currentIndex() == 2 ) { linkTarget = "_blank"; } const QString target = linkTarget; if( Settings::urlCachingEnabled() ) { QStringList linksList = confGroup->readEntry("LinksCache", QStringList()); linksList.append(link); confGroup->writeEntry("LinksCache", linksList ); confGroup->sync(); } emit addLink( link, target, ui.txtTitle->text() ); accept(); } else KDialog::slotButtonClicked(button); }
// Add edges to Graph representing map of Europe static void addConnections(Map g) { //### ROAD Connections ### addLink(g, ALICANTE, GRANADA, ROAD); addLink(g, ALICANTE, MADRID, ROAD); addLink(g, ALICANTE, SARAGOSSA, ROAD); addLink(g, AMSTERDAM, BRUSSELS, ROAD); addLink(g, AMSTERDAM, COLOGNE, ROAD); addLink(g, ATHENS, VALONA, ROAD); addLink(g, BARCELONA, SARAGOSSA, ROAD); addLink(g, BARCELONA, TOULOUSE, ROAD); addLink(g, BARI, NAPLES, ROAD); addLink(g, BARI, ROME, ROAD); addLink(g, BELGRADE, BUCHAREST, ROAD); addLink(g, BELGRADE, KLAUSENBURG, ROAD); addLink(g, BELGRADE, SARAJEVO, ROAD); addLink(g, BELGRADE, SOFIA, ROAD); addLink(g, BELGRADE, ST_JOSEPH_AND_ST_MARYS, ROAD); addLink(g, BELGRADE, SZEGED, ROAD); addLink(g, BERLIN, HAMBURG, ROAD); addLink(g, BERLIN, LEIPZIG, ROAD); addLink(g, BERLIN, PRAGUE, ROAD); addLink(g, BORDEAUX, CLERMONT_FERRAND, ROAD); addLink(g, BORDEAUX, NANTES, ROAD); addLink(g, BORDEAUX, SARAGOSSA, ROAD); addLink(g, BORDEAUX, TOULOUSE, ROAD); addLink(g, BRUSSELS, COLOGNE, ROAD); addLink(g, BRUSSELS, LE_HAVRE, ROAD); addLink(g, BRUSSELS, PARIS, ROAD); addLink(g, BRUSSELS, STRASBOURG, ROAD); addLink(g, BUCHAREST, CONSTANTA, ROAD); addLink(g, BUCHAREST, GALATZ, ROAD); addLink(g, BUCHAREST, KLAUSENBURG, ROAD); addLink(g, BUCHAREST, SOFIA, ROAD); addLink(g, BUDAPEST, KLAUSENBURG, ROAD); addLink(g, BUDAPEST, SZEGED, ROAD); addLink(g, BUDAPEST, VIENNA, ROAD); addLink(g, BUDAPEST, ZAGREB, ROAD); addLink(g, CADIZ, GRANADA, ROAD); addLink(g, CADIZ, LISBON, ROAD); addLink(g, CADIZ, MADRID, ROAD); addLink(g, CASTLE_DRACULA, GALATZ, ROAD); addLink(g, CASTLE_DRACULA, KLAUSENBURG, ROAD); addLink(g, CLERMONT_FERRAND, GENEVA, ROAD); addLink(g, CLERMONT_FERRAND, MARSEILLES, ROAD); addLink(g, CLERMONT_FERRAND, NANTES, ROAD); addLink(g, CLERMONT_FERRAND, PARIS, ROAD); addLink(g, CLERMONT_FERRAND, TOULOUSE, ROAD); addLink(g, COLOGNE, FRANKFURT, ROAD); addLink(g, COLOGNE, HAMBURG, ROAD); addLink(g, COLOGNE, LEIPZIG, ROAD); addLink(g, COLOGNE, STRASBOURG, ROAD); addLink(g, CONSTANTA, GALATZ, ROAD); addLink(g, CONSTANTA, VARNA, ROAD); addLink(g, DUBLIN, GALWAY, ROAD); addLink(g, EDINBURGH, MANCHESTER, ROAD); addLink(g, FLORENCE, GENOA, ROAD); addLink(g, FLORENCE, ROME, ROAD); addLink(g, FLORENCE, VENICE, ROAD); addLink(g, FRANKFURT, LEIPZIG, ROAD); addLink(g, FRANKFURT, NUREMBURG, ROAD); addLink(g, FRANKFURT, STRASBOURG, ROAD); addLink(g, GALATZ, KLAUSENBURG, ROAD); addLink(g, GENEVA, MARSEILLES, ROAD); addLink(g, GENEVA, PARIS, ROAD); addLink(g, GENEVA, STRASBOURG, ROAD); addLink(g, GENEVA, ZURICH, ROAD); addLink(g, GENOA, MARSEILLES, ROAD); addLink(g, GENOA, MILAN, ROAD); addLink(g, GENOA, VENICE, ROAD); addLink(g, GRANADA, MADRID, ROAD); addLink(g, HAMBURG, LEIPZIG, ROAD); addLink(g, KLAUSENBURG, SZEGED, ROAD); addLink(g, LEIPZIG, NUREMBURG, ROAD); addLink(g, LE_HAVRE, NANTES, ROAD); addLink(g, LE_HAVRE, PARIS, ROAD); addLink(g, LISBON, MADRID, ROAD); addLink(g, LISBON, SANTANDER, ROAD); addLink(g, LIVERPOOL, MANCHESTER, ROAD); addLink(g, LIVERPOOL, SWANSEA, ROAD); addLink(g, LONDON, MANCHESTER, ROAD); addLink(g, LONDON, PLYMOUTH, ROAD); addLink(g, LONDON, SWANSEA, ROAD); addLink(g, MADRID, SANTANDER, ROAD); addLink(g, MADRID, SARAGOSSA, ROAD); addLink(g, MARSEILLES, MILAN, ROAD); addLink(g, MARSEILLES, TOULOUSE, ROAD); addLink(g, MARSEILLES, ZURICH, ROAD); addLink(g, MILAN, MUNICH, ROAD); addLink(g, MILAN, VENICE, ROAD); addLink(g, MILAN, ZURICH, ROAD); addLink(g, MUNICH, NUREMBURG, ROAD); addLink(g, MUNICH, STRASBOURG, ROAD); addLink(g, MUNICH, VENICE, ROAD); addLink(g, MUNICH, VIENNA, ROAD); addLink(g, MUNICH, ZAGREB, ROAD); addLink(g, MUNICH, ZURICH, ROAD); addLink(g, NANTES, PARIS, ROAD); addLink(g, NAPLES, ROME, ROAD); addLink(g, NUREMBURG, PRAGUE, ROAD); addLink(g, NUREMBURG, STRASBOURG, ROAD); addLink(g, PARIS, STRASBOURG, ROAD); addLink(g, PRAGUE, VIENNA, ROAD); addLink(g, SALONICA, SOFIA, ROAD); addLink(g, SALONICA, VALONA, ROAD); addLink(g, SANTANDER, SARAGOSSA, ROAD); addLink(g, SARAGOSSA, TOULOUSE, ROAD); addLink(g, SARAJEVO, SOFIA, ROAD); addLink(g, SARAJEVO, ST_JOSEPH_AND_ST_MARYS, ROAD); addLink(g, SARAJEVO, VALONA, ROAD); addLink(g, SARAJEVO, ZAGREB, ROAD); addLink(g, SOFIA, VALONA, ROAD); addLink(g, SOFIA, VARNA, ROAD); addLink(g, STRASBOURG, ZURICH, ROAD); addLink(g, ST_JOSEPH_AND_ST_MARYS, SZEGED, ROAD); addLink(g, ST_JOSEPH_AND_ST_MARYS, ZAGREB, ROAD); addLink(g, SZEGED, ZAGREB, ROAD); addLink(g, VIENNA, ZAGREB, ROAD); //### RAIL Connections ### addLink(g, ALICANTE, BARCELONA, RAIL); addLink(g, ALICANTE, MADRID, RAIL); addLink(g, BARCELONA, SARAGOSSA, RAIL); addLink(g, BARI, NAPLES, RAIL); addLink(g, BELGRADE, SOFIA, RAIL); addLink(g, BELGRADE, SZEGED, RAIL); addLink(g, BERLIN, HAMBURG, RAIL); addLink(g, BERLIN, LEIPZIG, RAIL); addLink(g, BERLIN, PRAGUE, RAIL); addLink(g, BORDEAUX, PARIS, RAIL); addLink(g, BORDEAUX, SARAGOSSA, RAIL); addLink(g, BRUSSELS, COLOGNE, RAIL); addLink(g, BRUSSELS, PARIS, RAIL); addLink(g, BUCHAREST, CONSTANTA, RAIL); addLink(g, BUCHAREST, GALATZ, RAIL); addLink(g, BUCHAREST, SZEGED, RAIL); addLink(g, BUDAPEST, SZEGED, RAIL); addLink(g, BUDAPEST, VIENNA, RAIL); addLink(g, COLOGNE, FRANKFURT, RAIL); addLink(g, EDINBURGH, MANCHESTER, RAIL); addLink(g, FLORENCE, MILAN, RAIL); addLink(g, FLORENCE, ROME, RAIL); addLink(g, FRANKFURT, LEIPZIG, RAIL); addLink(g, FRANKFURT, STRASBOURG, RAIL); addLink(g, GENEVA, MILAN, RAIL); addLink(g, GENOA, MILAN, RAIL); addLink(g, LEIPZIG, NUREMBURG, RAIL); addLink(g, LE_HAVRE, PARIS, RAIL); addLink(g, LISBON, MADRID, RAIL); addLink(g, LIVERPOOL, MANCHESTER, RAIL); addLink(g, LONDON, MANCHESTER, RAIL); addLink(g, LONDON, SWANSEA, RAIL); addLink(g, MADRID, SANTANDER, RAIL); addLink(g, MADRID, SARAGOSSA, RAIL); addLink(g, MARSEILLES, PARIS, RAIL); addLink(g, MILAN, ZURICH, RAIL); addLink(g, MUNICH, NUREMBURG, RAIL); addLink(g, NAPLES, ROME, RAIL); addLink(g, PRAGUE, VIENNA, RAIL); addLink(g, SALONICA, SOFIA, RAIL); addLink(g, SOFIA, VARNA, RAIL); addLink(g, STRASBOURG, ZURICH, RAIL); addLink(g, VENICE, VIENNA, RAIL); //### BOAT Connections ### addLink(g, ADRIATIC_SEA, BARI, BOAT); addLink(g, ADRIATIC_SEA, IONIAN_SEA, BOAT); addLink(g, ADRIATIC_SEA, VENICE, BOAT); addLink(g, ALICANTE, MEDITERRANEAN_SEA, BOAT); addLink(g, AMSTERDAM, NORTH_SEA, BOAT); addLink(g, ATHENS, IONIAN_SEA, BOAT); addLink(g, ATLANTIC_OCEAN, BAY_OF_BISCAY, BOAT); addLink(g, ATLANTIC_OCEAN, CADIZ, BOAT); addLink(g, ATLANTIC_OCEAN, ENGLISH_CHANNEL, BOAT); addLink(g, ATLANTIC_OCEAN, GALWAY, BOAT); addLink(g, ATLANTIC_OCEAN, IRISH_SEA, BOAT); addLink(g, ATLANTIC_OCEAN, LISBON, BOAT); addLink(g, ATLANTIC_OCEAN, MEDITERRANEAN_SEA, BOAT); addLink(g, ATLANTIC_OCEAN, NORTH_SEA, BOAT); addLink(g, BARCELONA, MEDITERRANEAN_SEA, BOAT); addLink(g, BAY_OF_BISCAY, BORDEAUX, BOAT); addLink(g, BAY_OF_BISCAY, NANTES, BOAT); addLink(g, BAY_OF_BISCAY, SANTANDER, BOAT); addLink(g, BLACK_SEA, CONSTANTA, BOAT); addLink(g, BLACK_SEA, IONIAN_SEA, BOAT); addLink(g, BLACK_SEA, VARNA, BOAT); addLink(g, CAGLIARI, MEDITERRANEAN_SEA, BOAT); addLink(g, CAGLIARI, TYRRHENIAN_SEA, BOAT); addLink(g, DUBLIN, IRISH_SEA, BOAT); addLink(g, EDINBURGH, NORTH_SEA, BOAT); addLink(g, ENGLISH_CHANNEL, LE_HAVRE, BOAT); addLink(g, ENGLISH_CHANNEL, LONDON, BOAT); addLink(g, ENGLISH_CHANNEL, NORTH_SEA, BOAT); addLink(g, ENGLISH_CHANNEL, PLYMOUTH, BOAT); addLink(g, GENOA, TYRRHENIAN_SEA, BOAT); addLink(g, HAMBURG, NORTH_SEA, BOAT); addLink(g, IONIAN_SEA, SALONICA, BOAT); addLink(g, IONIAN_SEA, TYRRHENIAN_SEA, BOAT); addLink(g, IONIAN_SEA, VALONA, BOAT); addLink(g, IRISH_SEA, LIVERPOOL, BOAT); addLink(g, IRISH_SEA, SWANSEA, BOAT); addLink(g, MARSEILLES, MEDITERRANEAN_SEA, BOAT); addLink(g, MEDITERRANEAN_SEA, TYRRHENIAN_SEA, BOAT); addLink(g, NAPLES, TYRRHENIAN_SEA, BOAT); addLink(g, ROME, TYRRHENIAN_SEA, BOAT); }