-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Add disaply to UI to show number of active tracking sets
- Loading branch information
1 parent
cc00357
commit 347628c
Showing
10 changed files
with
167 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#ifdef _MSC_VER | ||
# define _CRT_SECURE_NO_WARNINGS | ||
#endif | ||
|
||
#include "ui_TrackingSetDockWidget.h" | ||
#include "ui/TrackingSetDockWidget.h" | ||
#include "ui/AutoscoperMainWindow.h" | ||
|
||
#include "Tracker.hpp" | ||
#include "Trial.hpp" | ||
|
||
TrackingSetDockWidget::TrackingSetDockWidget(QWidget* parent) | ||
: QDockWidget(parent) | ||
, dock(new Ui::TrackingSetDockWidget) | ||
{ | ||
dock->setupUi(this); | ||
mainwindow = dynamic_cast<AutoscoperMainWindow*>(parent); | ||
} | ||
|
||
TrackingSetDockWidget::~TrackingSetDockWidget() | ||
{ | ||
delete dock; | ||
} | ||
|
||
void TrackingSetDockWidget::addTrackingSet(const int& num_volumes) | ||
{ | ||
this->tracking_sets.push_back("Tracking set " + std::to_string(dock->listWidget->count())); | ||
QListWidgetItem* item = new QListWidgetItem(); | ||
int currentSet = this->mainwindow->getTracker()->trial()->numberOfCurveSets() - 1; | ||
item->setText(QString::fromStdString(this->tracking_sets[currentSet])); | ||
dock->listWidget->addItem(item); | ||
dock->listWidget->setCurrentItem(item); | ||
} | ||
|
||
void TrackingSetDockWidget::setCurrentSet(const int& idx) | ||
{ | ||
dock->listWidget->setCurrentRow(idx); | ||
} | ||
|
||
void TrackingSetDockWidget::on_listWidget_currentItemChanged(QListWidgetItem* current, QListWidgetItem* previous) | ||
{ | ||
if (current != NULL) { | ||
mainwindow->getTracker()->trial()->setCurrentCurveSet(dock->listWidget->row(current)); | ||
mainwindow->redrawGL(); | ||
mainwindow->frame_changed(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#ifndef TRACKINGSETDOCKWIDGET_H | ||
#define TRACKINGSETDOCKWIDGET_H | ||
|
||
#include <QDockWidget> | ||
|
||
// forward declarations | ||
namespace Ui { | ||
class TrackingSetDockWidget; | ||
} | ||
|
||
class AutoscoperMainWindow; | ||
class QListWidgetItem; | ||
|
||
class TrackingSetDockWidget : public QDockWidget | ||
{ | ||
|
||
Q_OBJECT | ||
|
||
public: | ||
explicit TrackingSetDockWidget(QWidget* parent = 0); | ||
~TrackingSetDockWidget(); | ||
|
||
AutoscoperMainWindow* getMainWindow() { return mainwindow; }; | ||
|
||
void addTrackingSet(const int& num_volumes); | ||
void setCurrentSet(const int& idx); | ||
|
||
private: | ||
Ui::TrackingSetDockWidget* dock; | ||
|
||
AutoscoperMainWindow* mainwindow; | ||
|
||
std::vector<std::string> tracking_sets; | ||
|
||
protected: | ||
public slots: | ||
void on_listWidget_currentItemChanged(QListWidgetItem* current, QListWidgetItem* previous); | ||
}; | ||
|
||
#endif // TRACKINGSETDOCKWIDGET_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>TrackingSetDockWidget</class> | ||
<widget class="QDockWidget" name="TrackingSetDockWidget"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>250</width> | ||
<height>115</height> | ||
</rect> | ||
</property> | ||
<property name="minimumSize"> | ||
<size> | ||
<width>91</width> | ||
<height>50</height> | ||
</size> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Tracking Sets</string> | ||
</property> | ||
<widget class="QWidget" name="dockWidgetContents"> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="QListWidget" name="listWidget"/> | ||
</item> | ||
</layout> | ||
</widget> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters