/* createGroups: * run after temp nodes are created */ void createGroups(Agraph_t* sg) { mcGroup* gr; Agraph_t* subg; Agnode_t* v; mcNode* leader; mcNode* mcn; for (subg = agfstsubg(sg); subg; subg = agnxtsubg(subg)) { if(is_a_cluster(subg)) { int isLeader=1; gr=initMcGroup(mcGrStrict); for (v = agfstnode(subg); v; v = agnxtnode(subg, v)) { mcn = MND_mcn(v); dtappend(gr->nodes,mcn); mcn->group=gr; mcn->groupOrder=0;/*this will be removed eventually */ mcn->isLeader=isLeader; if(isLeader==1) { leader = mcn; isLeader = 0; } mcn->leader = leader; } } else createGroups (subg); } }
//SLOT void Gui_Groups::refresh(int t) { switch(t) { case 0: { grplist->clear(); createGroups(); memlist->clear(); createMemList(showgrp->info1().toStdString()); } break; case 1: { grplist->clear(); createGroups(); memlist->clear(); } } }
void Ut_DBusInterfaceNotificationSink::testSendingGroupsToProxy() { QList<Notification> notifications; gNotificationManagerStub->stubSetReturnValue("notifications", notifications); QList<NotificationGroup> groups(createGroups()); gNotificationManagerStub->stubSetReturnValue("groups", groups); sink->registerSink("service1", "path"); QCOMPARE(gAddGroupProxies.count(), 1); }
bool ofxGLM::load(string sFile, float nScale, bool bNormalize) { char* filename = (char*)ofToDataPath(sFile, true).c_str(); model = glmReadOBJ(filename); if(!model) { ofLog(OF_LOG_ERROR, "Could not load model: %s", sFile.c_str()); return false; } if(bNormalize) { normalize(); } if(nScale != -1.0) { scale(nScale); } createMaterials(); createGroups(); return true; }
void VisualDebugger::sendEntireSDK() { PVD::PvdCommLayerError error; error = mPvdConnection->beginFrame(); NpPhysics& npPhysics = NpPhysics::getInstance(); error = mPvdConnection->createInstance(PvdClassKeys::PhysicsSDK+1, PX_PROFILE_POINTER_TO_U64(&npPhysics), PVD::EInstanceUIFlags::TopLevel); mMetaDataBinding.sendAllProperties( mPvdConnection, &npPhysics ); createGroups(); #define SEND_BUFFER_GROUP( type, name ) { \ Ps::Array<type*> buffers; \ PxU32 numBuffers = npPhysics.getNb##name(); \ buffers.resize(numBuffers); \ npPhysics.get##name(buffers.begin(), numBuffers); \ for(PxU32 i = 0; i < numBuffers; i++) \ increaseReference(buffers[i]); \ } SEND_BUFFER_GROUP( PxTriangleMesh, TriangleMeshes ); SEND_BUFFER_GROUP( PxConvexMesh, ConvexMeshes ); SEND_BUFFER_GROUP( PxHeightField, HeightFields ); SEND_BUFFER_GROUP( PxHeightField, HeightFields ); //Ensure that all the instances and class descriptions created so far //are available to the rest of the system. error = mPvdConnection->flush(); PxU32 numScenes = npPhysics.getNbScenes(); for(PxU32 i = 0; i < numScenes; i++) { NpScene* npScene = npPhysics.getScene(i); Scb::Scene& scbScene = npScene->getScene(); scbScene.getSceneVisualDebugger().sendEntireScene(); } error = mPvdConnection->endFrame(); error = mPvdConnection->flush(); }
CFactorGraph::CFactorGraph (const FactorGraph& fg) { groundFg_ = &fg; freeColor_ = 0; const VarNodes& varNodes = fg.varNodes(); varSignatures_.reserve (varNodes.size()); for (unsigned i = 0; i < varNodes.size(); i++) { unsigned c = (varNodes[i]->neighbors().size() * 2) + 1; varSignatures_.push_back (Signature (c)); } const FacNodes& facNodes = fg.facNodes(); facSignatures_.reserve (facNodes.size()); for (unsigned i = 0; i < facNodes.size(); i++) { unsigned c = facNodes[i]->neighbors().size() + 1; facSignatures_.push_back (Signature (c)); } varColors_.resize (varNodes.size()); facColors_.resize (facNodes.size()); setInitialColors(); createGroups(); }
void EvaluationGroupsBuilder::eventOccured(Event *event) { if(event == mEvolutionAlgorithmCompletedEvent) { createGroups(); } }
Gui_Groups::Gui_Groups(LinqClient* c, QWidget* parent) : QGridLayout(parent), _client(c) { Gui_Avatar* portrait = new Gui_Avatar(QString::fromStdString(_client->avatar())); QPushButton* create = new QPushButton("CREATE"); QLabel* title = new QLabel("NEW GROUP"); showgrp = new Gui_DisplayInfo; newpost = new QTextEdit; newgrp = new QLineEdit; search = new QLineEdit; newbox = new QGroupBox; memlbl = new QLabel("Members"); memlbl->setMaximumSize(80,20); grpname = new QLineEdit; newgrplayout = new QFormLayout; newgrplayout->setSpacing(15); newgrplayout->addRow(title); newgrplayout->addRow("Group name:", grpname); newgrplayout->addRow("Group description:", newgrp); newgrplayout->addRow(create); newbox->setLayout(newgrplayout); if(_client->level() < executive) newbox->hide(); search->setPlaceholderText("Search group.."); search->hide(); connect(search, SIGNAL(returnPressed()), this, SLOT(searchGroup())); post = new QPushButton("POST"); grplist = new QListWidget; memlist = new QListWidget; QLabel* grplbl = new QLabel("Groups"); grplbl->setMaximumSize(120,20); createGroups(); QFormLayout* frm = new QFormLayout; mbuttons[0] = new QPushButton; mbuttons[0]->setIcon(QPixmap("img/document185.png")); mbuttons[0]->setToolTip("New group"); mbuttons[1] = new QPushButton; mbuttons[1]->setIcon(QPixmap("img/cross108.png")); mbuttons[1]->setToolTip("Delete group"); mbuttons[2] = new QPushButton; mbuttons[2]->setIcon(QPixmap("img/mop2.png")); mbuttons[2]->setToolTip("Delete all posts"); mbuttons[3] = new QPushButton; mbuttons[3]->setIcon(QPixmap("img/exit6.png")); mbuttons[3]->setToolTip("Leave this group"); mbuttons[4] = new QPushButton; mbuttons[4]->setIcon(QPixmap("img/enter3.png")); mbuttons[4]->setToolTip("Join this group"); frm->addRow(mbuttons[0]); frm->addRow(mbuttons[3]); frm->addRow(mbuttons[4]); frm->addRow(mbuttons[1]); frm->addRow(mbuttons[2]); connect(mbuttons[0], SIGNAL(clicked()), this, SLOT(showNewGroup())); connect(create, SIGNAL(clicked()), this, SLOT(newGroup())); connect(mbuttons[1], SIGNAL(clicked()), this, SLOT(deleteGroup())); connect(mbuttons[2], SIGNAL(clicked()), this, SLOT(clearPosts())); connect(mbuttons[3], SIGNAL(clicked()), this, SLOT(leaveGroup())); connect(mbuttons[4], SIGNAL(clicked()), this, SLOT(addGroup())); mbuttons[0]->hide(); mbuttons[1]->hide(); mbuttons[2]->hide(); mbuttons[3]->hide(); mbuttons[4]->hide(); if(_client->level() >= executive) mbuttons[0]->show(); tbar = new QToolBar; tbuttons[0] = new QToolButton(tbar); tbuttons[0]->setIcon(QPixmap("img/cross108.png")); tbar->addWidget(tbuttons[0]); newpost->setStyleSheet("background: #1a1a1a; font-weight:400"); newpost->setPlaceholderText("Insert new post into this group."); newpost->hide(); post->hide(); showgrp->hide(); memlbl->hide(); memlist->hide(); memlist->setContextMenuPolicy(Qt::CustomContextMenu); connect(memlist, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(memListMenu(const QPoint&))); addWidget(newbox, 0, 1, 1, 1); addWidget(portrait, 0, 0, 1, 1, Qt::AlignTop); addWidget(showgrp, 0, 1, 3, 1); addLayout(frm, 0, 2, 1, 1, Qt::AlignRight); addWidget(newpost, 3, 1, 2, 3); addWidget(post, 5, 4, 1, 1, Qt::AlignRight); addWidget(grplbl, 1, 0, 1, 1); addWidget(grplist, 2, 0, 1, 1); addWidget(memlbl, 3, 0, 1, 1); addWidget(memlist, 4, 0, 1, 1); addWidget(search, 5, 0, 1, 1); setRowStretch(0, 0); setRowStretch(1, 10); setColumnStretch(0, 1); setColumnStretch(1, 5); connect(grplist, SIGNAL(clicked(QModelIndex)), this, SLOT(showGroup())); connect(post, SIGNAL(clicked()), this, SLOT(sendPost())); connect(this, SIGNAL(created(int)), this, SLOT(refresh(int))); }