AnnotationWidget::AnnotationWidget(QWidget *parent) : QDialog(parent) { setWindowIcon(QIcon(":/images/icons/graph.png")); setWindowTitle("Annotation"); tabs = new QTabWidget(this); treeviewTab = new ToolsTreeviewTab(this); commandsTab = new ToolsCommandsTab(this); tabs->addTab(treeviewTab, "Tree View"); tabs->addTab(commandsTab, "Commands"); treeCountLabel = new QLabel("Total Tree Count: 0"); nodeCountLabel = new QLabel("Total Node Count: 0"); nodeCountLabel->setToolTip("Total number of nodes in the skeleton."); listedNodesLabel = new QLabel("Currently Listed Nodes: 0"); listedNodesLabel->setToolTip("Number of nodes currently listed in the table."); QHBoxLayout *hLayout = new QHBoxLayout(); QHBoxLayout *subHLayout = new QHBoxLayout(); subHLayout->addWidget(listedNodesLabel, 0, Qt::AlignLeft); subHLayout->addWidget(nodeCountLabel, 0, Qt::AlignRight); hLayout->addWidget(treeCountLabel); hLayout->addLayout(subHLayout); mainLayout = new QVBoxLayout(this); mainLayout->addWidget(tabs); mainLayout->addLayout(hLayout); setLayout(mainLayout); connect(treeviewTab, &ToolsTreeviewTab::updateAnnotationLabelsSignal, this, &AnnotationWidget::updateLabels); connect(commandsTab, SIGNAL(treeActivatedSignal()), treeviewTab, SLOT(treeActivated())); connect(commandsTab, SIGNAL(treeAddedSignal(treeListElement*)), treeviewTab, SLOT(treeAdded(treeListElement*))); connect(commandsTab, SIGNAL(nodeActivatedSignal()), treeviewTab, SLOT(nodeActivated())); connect(commandsTab, SIGNAL(branchPushedSignal()), treeviewTab, SLOT(branchPushed())); connect(commandsTab, SIGNAL(branchPoppedSignal()), treeviewTab, SLOT(branchPopped())); this->setWindowFlags(this->windowFlags() & (~Qt::WindowContextHelpButtonHint)); }
void ToolsCommandsTab::activeTreeIDSpinChanged(int value) { treeListElement *tree = findTreeByTreeIDSignal(value); if(tree == NULL) { return; // // no tree with this value. // // jump to next or previous tree, depending on wether spin box value is greater or smaller than active tree id // if(state->skeletonState->activeTree == NULL) { // no active node, activate first node found // tree = Skeletonizer::getTreeWithNextID(NULL); // } // else { // if(value > state->skeletonState->activeTree->treeID) { // move to next node // tree = Skeletonizer::getTreeWithNextID(state->skeletonState->activeTree); // } // else if(value < state->skeletonState->activeTree->treeID) { // tree = Skeletonizer::getTreeWithPrevID(state->skeletonState->activeTree); // } // } } if(tree) { setActiveTreeSignal(tree->treeID); emit treeActivatedSignal(); } return; }