Skip to content

Commit 541f390

Browse files
author
Hauke Jürgen Mönck
committed
Merge remote-tracking branch 'remotes/origin/BioTracker3_View+' into BioTracker3_publication
2 parents b139668 + ddf8332 commit 541f390

15 files changed

Lines changed: 59 additions & 31 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,5 @@ CMakeFiles
121121
.vscode/tasks.json
122122
.vscode/launch.json
123123
.vscode/c_cpp_properties.json
124+
.vscode/c_cpp_properties.json
125+
.vscode/c_cpp_properties.json

.vscode/c_cpp_properties.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,16 @@
4040
"/usr/include/qt4/QtCore",
4141
"/usr/local/include/opencv",
4242
"/usr/include/qt4/QtGui",
43-
"${workspaceRoot}/BioTracker/Interfaces/BioTrackerInterfaces"
43+
"${workspaceRoot}/BioTracker/Interfaces/BioTrackerInterfaces",
44+
"${workspaceRoot}/BioTracker/CoreApp/BioTracker",
45+
"${workspaceRoot}/BioTracker/Utils/BioTrackerUtils",
46+
"${workspaceRoot}/BioTracker/Utils/BioTrackerUtils",
47+
"/usr/include/x86_64-linux-gnu/qt5/QtWidgets",
48+
"/usr/include/x86_64-linux-gnu/qt5",
49+
"/usr/include/x86_64-linux-gnu/qt5/QtGui",
50+
"/usr/include/x86_64-linux-gnu/qt5/QtMultimedia",
51+
"/usr/include/x86_64-linux-gnu/qt5/QtMultimediaWidgets",
52+
"/usr/include/x86_64-linux-gnu/qt5/QtCore"
4453
],
4554
"defines": [],
4655
"intelliSenseMode": "clang-x64",

BioTracker/CoreApp/BioTracker/Controller/ControllerCoreParameter.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ void ControllerCoreParameter::connectControllerToController()
7070
QObject::connect(view, &CoreParameterView::emitToggleAntialiasingEntities, tcview, &TrackedComponentView::receiveToggleAntialiasingEntities, Qt::DirectConnection);
7171
QObject::connect(view, &CoreParameterView::emitToggleAntialiasingFull, ctrGrphScn, &ControllerGraphicScene::receiveToggleAntialiasingFull, Qt::DirectConnection);
7272

73-
74-
75-
//
7673
}
7774
//Connections to the AreaDescriptor
7875
{

BioTracker/CoreApp/BioTracker/Controller/ControllerDataExporter.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#include "ControllerDataExporter.h"
2+
#include "Controller/ControllerCommands.h"
3+
#include "Controller/ControllerTrackedComponentCore.h"
24
#include "Model/DataExporters/DataExporterCSV.h"
35
#include "Model/DataExporters/DataExporterSerialize.h"
46
#include "Model/DataExporters/DataExporterJson.h"
@@ -22,6 +24,18 @@ void ControllerDataExporter::cleanup() {
2224
}
2325

2426
void ControllerDataExporter::connectControllerToController() {
27+
//connect to controller commands
28+
IController* ictrcmd = m_BioTrackerContext->requestController(ENUMS::CONTROLLERTYPE::COMMANDS);
29+
ControllerCommands *ctrcmd = static_cast<ControllerCommands*>(ictrcmd);
30+
31+
QObject::connect(this, &ControllerDataExporter::emitResetUndoStack, ctrcmd, &ControllerCommands::receiveClear, Qt::DirectConnection);
32+
33+
//connect to view controller
34+
IController* ctr = m_BioTrackerContext->requestController(ENUMS::CONTROLLERTYPE::TRACKEDCOMPONENTCORE
35+
);
36+
ControllerTrackedComponentCore *tccController = dynamic_cast<ControllerTrackedComponentCore*>(ctr);
37+
38+
QObject::connect(this, &ControllerDataExporter::emitViewUpdate, tccController, &ControllerTrackedComponentCore::receiveUpdateView, Qt::DirectConnection);
2539
}
2640

2741
void ControllerDataExporter::createModel() {
@@ -89,14 +103,18 @@ void ControllerDataExporter::receiveTrackingDone(uint frame) {
89103

90104
void ControllerDataExporter::receiveFinalizeExperiment() {
91105
if (getModel()) {
106+
emitResetUndoStack();
92107
dynamic_cast<IModelDataExporter*>(getModel())->finalizeAndReInit();
108+
emitViewUpdate();
93109
}
94110
}
95111

96112
void ControllerDataExporter::receiveReset() {
97113
if (getModel()) {
114+
emitResetUndoStack();
98115
dynamic_cast<IModelDataExporter*>(getModel())->finalizeAndReInit();
99116
dynamic_cast<IModelDataExporter*>(getModel())->close();
117+
emitViewUpdate();
100118
}
101119

102120
createModel();

BioTracker/CoreApp/BioTracker/Controller/ControllerDataExporter.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ class ControllerDataExporter : public IController {
3131

3232
void loadFile(std::string file);
3333

34+
Q_SIGNALS:
35+
void emitResetUndoStack();
36+
void emitViewUpdate();
37+
3438
public Q_SLOTS:
3539
void receiveReset();
3640
void receiveTrackingDone(uint frame);

BioTracker/CoreApp/BioTracker/Controller/ControllerMainWindow.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ void ControllerMainWindow::connectControllerToController() {
141141
QObject::connect(this, &ControllerMainWindow::emitRedoCommand, ctrcmd, &ControllerCommands::receiveRedo, Qt::DirectConnection);
142142
QObject::connect(this, &ControllerMainWindow::emitOnLoadMedia, ctrcmd, &ControllerCommands::receiveClear, Qt::DirectConnection);
143143
QObject::connect(this, &ControllerMainWindow::emitOnLoadPlugin, ctrcmd, &ControllerCommands::receiveClear, Qt::DirectConnection);
144+
//QObject::connect(this, &ControllerMainWindow::emit, ctrcmd, &ControllerCommands::receiveClear, Qt::DirectConnection);
144145
QObject::connect(this, &ControllerMainWindow::emitShowActionListCommand, ctrcmd, &ControllerCommands::receiveShowActionList, Qt::DirectConnection);
145146

146147
//

BioTracker/CoreApp/BioTracker/Model/Annotations.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ void Annotations::deserialize()
7979
annotation = std::make_shared<AnnotationArrow>();
8080
else if (type == "label")
8181
annotation = std::make_shared<AnnotationLabel>();
82+
else if (type == "rect")
83+
annotation = std::make_shared<AnnotationRect>();
84+
else if (type == "ellipse")
85+
annotation = std::make_shared<AnnotationEllipse>();
8286
if (annotation)
8387
{
8488
annotation->deserializeFrom(args);
@@ -329,11 +333,13 @@ bool Annotations::updateAnnotation(QPoint cursor)
329333
if (currentAnnotation)
330334
{
331335
currentAnnotation->onEndAnnotation(cursor);
336+
dirty = true;
332337
return true;
333338
}
334339
if (selection)
335340
{
336341
*selection.handle = cursor;
342+
dirty = true;
337343
return true;
338344
}
339345
return false;
@@ -375,8 +381,10 @@ bool Annotations::removeSelection()
375381
for (auto iter = annotations.begin(); iter != annotations.end();)
376382
{
377383
const auto annotation = *iter;
378-
if (annotation.get() == selectedAnnotation)
384+
if (annotation.get() == selectedAnnotation){
379385
iter = annotations.erase(iter);
386+
dirty = true;
387+
}
380388
else
381389
++iter;
382390
}

BioTracker/CoreApp/BioTracker/Model/Annotations.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class Annotations : public IModel {
115115
using Annotation::Annotation;
116116
virtual ~AnnotationEllipse() = default;
117117

118-
virtual std::string name() const override { return "rect"; }
118+
virtual std::string name() const override { return "ellipse"; }
119119
virtual void deserializeFrom(std::queue<std::string> &args);
120120
virtual std::vector<std::string> serializeToVector() const;
121121
virtual bool onEndAnnotation(QPoint currentPosition) override { bottomRight = currentPosition; return true; };

BioTracker/CoreApp/BioTracker/View/GraphicsView.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ GraphicsView::GraphicsView(QWidget *parent, IController *controller, IModel *mod
1919
m_BackgroundImage = NULL;
2020

2121
this->setScene(m_GraphicsScene);
22-
this->setViewport(new QGLWidget());
22+
//this->setViewport(new QGLWidget());
2323

2424
this->setBackgroundBrush(QBrush(Qt::white));
2525

BioTracker/CoreApp/BioTracker/View/MainWindow.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ void MainWindow::addTrackerElementsView(IView *elemView)
5252
_currentCoreView->setParent(0);
5353
m_graphView->removeGraphicsItem(_currentElementView);
5454
m_graphView->removeGraphicsItem(_currentCoreView);
55-
5655
}
5756
QGraphicsObject *graphObj = dynamic_cast<QGraphicsObject *>(elemView);
5857
graphObj->setParent(ui->trackingArea);

0 commit comments

Comments
 (0)