TricComp::TricComp (const Graph& G) : m_ESTACK(G.numberOfEdges()) { m_pGC = new GraphCopySimple(G); GraphCopySimple &GC = *m_pGC; const int n = GC.numberOfNodes(); const int m = GC.numberOfEdges(); #ifdef TRIC_COMP_OUTPUT cout << "Dividing G into triconnected components.\n" << endl; cout << "n = " << n << ", m = " << m << endl << endl; #endif m_component = Array<CompStruct>(3*m-6); m_numComp = 0; // special cases OGDF_ASSERT(n >= 2); OGDF_ASSERT_IF(dlExtendedChecking, isBiconnected(G)); if (n <= 2) { OGDF_ASSERT(m >= 3); CompStruct &C = newComp(); edge e; forall_edges(e,GC) C << e; C.m_type = bond; return; } m_TYPE.init(GC,unseen); splitMultiEdges(); // initialize arrays m_NUMBER.init(GC,0); m_LOWPT1.init(GC); m_LOWPT2.init(GC); m_FATHER.init(GC,0); m_ND .init(GC); m_DEGREE.init(GC); m_TREE_ARC.init(GC,0); m_NODEAT = Array<node>(1,n); m_numCount = 0; m_start = GC.firstNode(); DFS1(GC,m_start,0); edge e; forall_edges(e,GC) { bool up = (m_NUMBER[e->target()] - m_NUMBER[e->source()] > 0); if ((up && m_TYPE[e] == frond) || (!up && m_TYPE[e] == tree)) GC.reverseEdge(e); }
vector<Computer>Computerrepository::queryComputerTable(QSqlQuery query) { computerList.clear(); while (query.next()) { int id = query.value("id").toUInt(); string name = query.value("Name").toString().toStdString(); string type = query.value("Type").toString().toStdString(); bool builtOrNot = query.value("BuiltOrNot").toUInt(); int builtY = query.value("YearBuilt").toUInt(); Computer newComp(id, name, type, builtOrNot, builtY); computerList.push_back(newComp); } return computerList; }
std::unique_ptr<CaffEnt::Component> ScriptManager::getComponent(const std::string &name) { if(m_componentScripts.count(name)) { const ScriptDetails &details = m_componentScripts.at(name); //ASHelper::ScriptObject scriptObj = m_asContext.getScriptObject(details.scriptName); std::unique_ptr<CaffEnt::Component> newComp(new CaffInter::ScriptComponent(m_asContext, details.scriptName)); return newComp; } return std::unique_ptr<CaffEnt::Component>(); }
if (m_START[e]) { printOs(e); } } #endif m_TSTACK_h = new int[2*m+1]; m_TSTACK_a = new int[2*m+1]; m_TSTACK_b = new int[2*m+1]; m_TSTACK_a[m_top = 0] = -1; // start with EOS pathSearch(G,m_start); // last split component CompStruct &C = newComp(); while(!m_ESTACK.empty()) { C << m_ESTACK.pop(); } C.m_type = (C.m_edges.size() > 4) ? triconnected : polygon; #ifdef TRIC_COMP_OUTPUT printStacks(); #endif delete [] m_TSTACK_h; delete [] m_TSTACK_a; delete [] m_TSTACK_b; // free resources m_NUMBER.init(); m_LOWPT1.init();
PartList::PartList(QWidget *parent) : QWidget(parent), ui(new Ui::PartList) { ui->setupUi(this); // mAssetListWidget = findChild<AssetListWidget*>("assetList"); // connect(mAssetListWidget, SIGNAL(assetDoubleClicked(AssetRef)), this, SIGNAL(assetDoubleClicked(AssetRef))); mAssetTreeWidget = findChild<AssetTreeWidget*>("assetTree"); connect(mAssetTreeWidget, SIGNAL(assetDoubleClicked(AssetRef)), this, SIGNAL(assetDoubleClicked(AssetRef))); connect(findChild<QToolButton*>("toolButtonNewPart"), SIGNAL(clicked()), this, SLOT(newPart())); connect(findChild<QToolButton*>("toolButtonNewComp"), SIGNAL(clicked()), this, SLOT(newComp())); connect(findChild<QToolButton*>("toolButtonNewFolder"), SIGNAL(clicked()), this, SLOT(newFolder())); connect(findChild<QToolButton*>("toolButtonRenameAsset"), SIGNAL(clicked()), this, SLOT(renameAsset())); connect(findChild<QToolButton*>("toolButtonCopyAsset"), SIGNAL(clicked()), this, SLOT(copyAsset())); connect(findChild<QToolButton*>("toolButtonDeleteAsset"), SIGNAL(clicked()), this, SLOT(deleteAsset())); updateList(); }