From bb2944261fbf7882a48eeff70199273989587bb1 Mon Sep 17 00:00:00 2001 From: "alexey.pavlov" Date: Mon, 19 Feb 2024 10:25:45 +0100 Subject: [PATCH 01/11] test code --- anno/MainWindow.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/anno/MainWindow.cpp b/anno/MainWindow.cpp index ee2a043..cd242cb 100644 --- a/anno/MainWindow.cpp +++ b/anno/MainWindow.cpp @@ -112,6 +112,20 @@ MainWindow::MainWindow(QWidget *parent) ui.mouse_pos_label->setElideMode(Qt::ElideRight); ui.color_value_label->setElideMode(Qt::ElideRight); + // navigation + QWidget *spacerWidget = new QWidget(this); + spacerWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + spacerWidget->setVisible(true); + + QPushButton* testButtton = new QPushButton("Test", this); + + ui.mainToolBar->addSeparator(); + ui.mainToolBar->addWidget(testButtton); + ui.mainToolBar->addWidget(spacerWidget); + + + + UpdateApplicationTitle(); UpdateProjectControls(); From 9f62e43b9ca90f4f05401f8dd91014784246370a Mon Sep 17 00:00:00 2001 From: "alexey.pavlov" Date: Mon, 19 Feb 2024 10:41:07 +0100 Subject: [PATCH 02/11] fix windows release build --- anno/anno.vcxproj | 2 +- anno/anno.vcxproj.filters | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/anno/anno.vcxproj b/anno/anno.vcxproj index ca287f6..3fa380a 100644 --- a/anno/anno.vcxproj +++ b/anno/anno.vcxproj @@ -284,7 +284,7 @@ xcopy /E /D /Y /I $(OPENCV_BIN_DIR)\opencv_imgcodecs$(OPENCV_VER).dll "$(OutDir) true - true + true true diff --git a/anno/anno.vcxproj.filters b/anno/anno.vcxproj.filters index 3a66386..1de8439 100644 --- a/anno/anno.vcxproj.filters +++ b/anno/anno.vcxproj.filters @@ -472,7 +472,7 @@ Generated Files\Debug - Generated Files\Debug + Generated Files\Release Source Files\UI From 40ce0da19358474a2dff51e3f648be3c533c5a95 Mon Sep 17 00:00:00 2001 From: "alexey.pavlov" Date: Wed, 21 Feb 2024 11:59:26 +0100 Subject: [PATCH 03/11] NavigationWidget added --- anno/MainWindow.cpp | 14 +++--- anno/MainWindow.qrc | 65 ++++++++++++------------- anno/NavigationWidget.cpp | 11 +++++ anno/NavigationWidget.h | 21 +++++++++ anno/NavigationWidget.ui | 97 ++++++++++++++++++++++++++++++++++++++ anno/Resources/info.ico | Bin 0 -> 7886 bytes anno/anno.vcxproj | 29 ++++++++++++ anno/anno.vcxproj.filters | 18 +++++++ 8 files changed, 217 insertions(+), 38 deletions(-) create mode 100644 anno/NavigationWidget.cpp create mode 100644 anno/NavigationWidget.h create mode 100644 anno/NavigationWidget.ui create mode 100644 anno/Resources/info.ico diff --git a/anno/MainWindow.cpp b/anno/MainWindow.cpp index cd242cb..e7890fc 100644 --- a/anno/MainWindow.cpp +++ b/anno/MainWindow.cpp @@ -9,6 +9,7 @@ #include "ImageSettingsWidget.h" #include "LabelDefinitionPropertiesWidget.h" #include "messagebox.h" +#include "NavigationWidget.h" #include "ProjectDefinitionsDialog.h" #include "ProjectSettingsWidget.h" #include "LabelPropertiesWidget.h" @@ -113,16 +114,17 @@ MainWindow::MainWindow(QWidget *parent) ui.color_value_label->setElideMode(Qt::ElideRight); // navigation + ui.mainToolBar->addSeparator(); + + NavigationWidget* navigationWidget = new NavigationWidget(this); + ui.mainToolBar->addWidget(navigationWidget); + + /* QWidget *spacerWidget = new QWidget(this); spacerWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); spacerWidget->setVisible(true); - - QPushButton* testButtton = new QPushButton("Test", this); - - ui.mainToolBar->addSeparator(); - ui.mainToolBar->addWidget(testButtton); ui.mainToolBar->addWidget(spacerWidget); - + */ diff --git a/anno/MainWindow.qrc b/anno/MainWindow.qrc index 25719e3..aa07719 100644 --- a/anno/MainWindow.qrc +++ b/anno/MainWindow.qrc @@ -1,34 +1,35 @@ - - Resources/paste.ico - Resources/3d.ico - Resources/open.ico - Resources/save.ico - Resources/Redo.ico - Resources/Undo.ico - Resources/file.ico - Resources/folder.ico - Resources/image.ico - Resources/delete.ico - Resources/refresh.ico - Resources/configuration.ico - Resources/folder_network.ico - Resources/file_blue.ico - Resources/add.ico - Resources/fit_to_size.ico - Resources/fix.ico - Resources/restart.ico - Resources/select.png - Resources/anno.ico - Resources/new.ico - Resources/copy.ico - Resources/find.ico - Resources/nav_back.ico - Resources/nav_forward.ico - Resources/rename.ico - Resources/clean.ico - Resources/tree_view.ico - Resources/component.ico - Resources/search-inside.ico - + + Resources/paste.ico + Resources/info.ico + Resources/3d.ico + Resources/open.ico + Resources/save.ico + Resources/Redo.ico + Resources/Undo.ico + Resources/file.ico + Resources/folder.ico + Resources/image.ico + Resources/delete.ico + Resources/refresh.ico + Resources/configuration.ico + Resources/folder_network.ico + Resources/file_blue.ico + Resources/add.ico + Resources/fit_to_size.ico + Resources/fix.ico + Resources/restart.ico + Resources/select.png + Resources/anno.ico + Resources/new.ico + Resources/copy.ico + Resources/find.ico + Resources/nav_back.ico + Resources/nav_forward.ico + Resources/rename.ico + Resources/clean.ico + Resources/tree_view.ico + Resources/component.ico + Resources/search-inside.ico + diff --git a/anno/NavigationWidget.cpp b/anno/NavigationWidget.cpp new file mode 100644 index 0000000..bdd01c7 --- /dev/null +++ b/anno/NavigationWidget.cpp @@ -0,0 +1,11 @@ +// Anno Labeling Tool +// 2020-2024 (c) urobots GmbH, https://urobots.io/en/portfolio/anno/ +#include "NavigationWidget.h" + +NavigationWidget::NavigationWidget(QWidget *parent) + : QWidget(parent) { + ui.setupUi(this); +} + +NavigationWidget::~NavigationWidget() { +} \ No newline at end of file diff --git a/anno/NavigationWidget.h b/anno/NavigationWidget.h new file mode 100644 index 0000000..0f77029 --- /dev/null +++ b/anno/NavigationWidget.h @@ -0,0 +1,21 @@ +#pragma once +#include "ui_NavigationWidget.h" +#include + + +class NavigationWidget : public QWidget +{ + Q_OBJECT + +public: + NavigationWidget(QWidget *parent = nullptr); + ~NavigationWidget(); + +signals: + +public slots: + + +private: + Ui::NavigationWidget ui; +}; diff --git a/anno/NavigationWidget.ui b/anno/NavigationWidget.ui new file mode 100644 index 0000000..aed5db9 --- /dev/null +++ b/anno/NavigationWidget.ui @@ -0,0 +1,97 @@ + + + NavigationWidget + + + + 0 + 0 + 690 + 210 + + + + + 0 + 0 + + + + NavigationWidget + + + + 2 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + :/MainWindow/Resources/nav_back.ico:/MainWindow/Resources/nav_back.ico + + + + 24 + 24 + + + + true + + + + + + + + + + + :/MainWindow/Resources/nav_forward.ico:/MainWindow/Resources/nav_forward.ico + + + + 24 + 24 + + + + true + + + + + + + + 0 + 0 + + + + true + + + + + + + + + + diff --git a/anno/Resources/info.ico b/anno/Resources/info.ico new file mode 100644 index 0000000000000000000000000000000000000000..db44b6bca0772e3a388df8424c4206cefe7c11f0 GIT binary patch literal 7886 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 true + + true + true @@ -295,6 +298,9 @@ xcopy /E /D /Y /I $(OPENCV_BIN_DIR)\opencv_imgcodecs$(OPENCV_VER).dll "$(OutDir) true + + true + true @@ -349,6 +355,7 @@ xcopy /E /D /Y /I $(OPENCV_BIN_DIR)\opencv_imgcodecs$(OPENCV_VER).dll "$(OutDir) + @@ -498,6 +505,7 @@ xcopy /E /D /Y /I $(OPENCV_BIN_DIR)\opencv_imgcodecs$(OPENCV_VER).dll "$(OutDir) + @@ -532,6 +540,16 @@ xcopy /E /D /Y /I $(OPENCV_BIN_DIR)\opencv_imgcodecs$(OPENCV_VER).dll "$(OutDir) "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../%(Filename)%(Extension)" -DANNO_USE_OPENCV -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DNDEBUG -DQT_SCRIPT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_WINEXTRAS_LIB -DQT_WIDGETS_LIB -DQT_QML_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I$(ProjectDir).." "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(OPENCV_DIR)\include" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\IlmImf" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\Half" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\Iex" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\Imath" "-I$(QTDIR)\include\QtScript" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtWinExtras" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtQml" + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../%(Filename)%(Extension)" -DANNO_USE_OPENCV -DUNICODE -DWIN32 -DWIN64 -DQT_SCRIPT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_WINEXTRAS_LIB -DQT_WIDGETS_LIB -DQT_QML_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I$(ProjectDir).." "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(OPENCV_DIR)\include" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\IlmImf" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\Half" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\Iex" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\Imath" "-I$(QTDIR)\include\QtScript" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtWinExtras" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtQml" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../%(Filename)%(Extension)" -DANNO_USE_OPENCV -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DNDEBUG -DQT_SCRIPT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_WINEXTRAS_LIB -DQT_WIDGETS_LIB -DQT_QML_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I$(ProjectDir).." "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(OPENCV_DIR)\include" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\IlmImf" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\Half" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\Iex" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\Imath" "-I$(QTDIR)\include\QtScript" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtWinExtras" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtQml" + @@ -1114,6 +1132,17 @@ xcopy /E /D /Y /I $(OPENCV_BIN_DIR)\opencv_imgcodecs$(OPENCV_VER).dll "$(OutDir) .\GeneratedFiles\ui_%(Filename).h;%(Outputs) "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + Designer + diff --git a/anno/anno.vcxproj.filters b/anno/anno.vcxproj.filters index 1de8439..c8c5d36 100644 --- a/anno/anno.vcxproj.filters +++ b/anno/anno.vcxproj.filters @@ -561,6 +561,15 @@ Source Files\UI + + Generated Files\Debug + + + Generated Files\Release + + + Source Files\UI + @@ -761,6 +770,9 @@ Generated Files + + Generated Files + @@ -937,6 +949,12 @@ Form Files + + Form Files + + + Header Files\UI + From cec01eda8aff5e495167db9e48fba6487fac4358 Mon Sep 17 00:00:00 2001 From: "alexey.pavlov" Date: Wed, 21 Feb 2024 16:27:55 +0100 Subject: [PATCH 04/11] Implement navigation model --- anno/ApplicationModel.cpp | 6 ++++- anno/ApplicationModel.h | 5 ++++ anno/MainWindow.cpp | 2 +- anno/MainWindow.h | 2 +- anno/NavigationModel.cpp | 45 +++++++++++++++++++++++++++++++ anno/NavigationModel.h | 46 ++++++++++++++++++++++++++++++++ anno/NavigationWidget.cpp | 16 +++++++++-- anno/NavigationWidget.h | 4 ++- anno/SourcePicturesTreeModel.cpp | 36 +++++++++++++++++++++++++ anno/SourcePicturesTreeModel.h | 4 ++- anno/SourcePicturesWidget.cpp | 36 +++++++++++++++++++++++-- anno/SourcePicturesWidget.h | 5 ++++ anno/anno.vcxproj | 17 ++++++++++++ anno/anno.vcxproj.filters | 12 +++++++++ 14 files changed, 227 insertions(+), 9 deletions(-) create mode 100644 anno/NavigationModel.cpp create mode 100644 anno/NavigationModel.h diff --git a/anno/ApplicationModel.cpp b/anno/ApplicationModel.cpp index 2c6b9ce..a40bc2b 100644 --- a/anno/ApplicationModel.cpp +++ b/anno/ApplicationModel.cpp @@ -39,7 +39,9 @@ using namespace std; ApplicationModel::ApplicationModel(QObject *parent) - : QObject(parent) { + : QObject(parent) + , navigation_model_(nullptr) +{ } ApplicationModel::~ApplicationModel() { @@ -54,6 +56,8 @@ void ApplicationModel::ClearProject() { files_loader_ = QJsonObject(); file_models_.clear(); + navigation_model_.Clear(); + PropertyDatabase::Instance().Clear(); set_is_modified(false); } diff --git a/anno/ApplicationModel.h b/anno/ApplicationModel.h index d11bf13..068bd05 100644 --- a/anno/ApplicationModel.h +++ b/anno/ApplicationModel.h @@ -3,6 +3,7 @@ #include "ImageConverter.h" #include "implement_q_property.h" #include "LabelDefinitionsTreeModel.h" +#include "NavigationModel.h" #include "SourcePicturesTreeModel.h" #include @@ -21,6 +22,8 @@ class ApplicationModel : public QObject, public FileModelProviderInterface Q_PROPERTY(std::shared_ptr filesystem READ get_filesystem WRITE set_filesystem NOTIFY filesystem_changed); Q_PROPERTY(QJsonObject user_data READ get_user_data WRITE set_user_data NOTIFY user_data_changed); + NavigationModel* get_navigation_model() { return &navigation_model_; } + void NewProject(QString images_folder); bool OpenProject(QString filename, QStringList &errors); bool SaveProject(QStringList & errors, QString filename = QString()); @@ -119,6 +122,8 @@ public slots: QString project_script_; + NavigationModel navigation_model_; + public: IMPLEMENT_Q_PROPERTY_READ(is_modified); IMPLEMENT_Q_PROPERTY_READ(user_data); diff --git a/anno/MainWindow.cpp b/anno/MainWindow.cpp index e7890fc..c0434ea 100644 --- a/anno/MainWindow.cpp +++ b/anno/MainWindow.cpp @@ -116,7 +116,7 @@ MainWindow::MainWindow(QWidget *parent) // navigation ui.mainToolBar->addSeparator(); - NavigationWidget* navigationWidget = new NavigationWidget(this); + NavigationWidget* navigationWidget = new NavigationWidget(model_.get_navigation_model(), this); ui.mainToolBar->addWidget(navigationWidget); /* diff --git a/anno/MainWindow.h b/anno/MainWindow.h index 35ea90d..7b5db7e 100644 --- a/anno/MainWindow.h +++ b/anno/MainWindow.h @@ -47,7 +47,7 @@ public slots: void OnProjectSettings(); void UpdateApplicationTitle(); void UpdateProjectControls(); - void OnEvaluateInROI(); + void OnEvaluateInROI(); private: bool CloseActiveProject(); diff --git a/anno/NavigationModel.cpp b/anno/NavigationModel.cpp new file mode 100644 index 0000000..a6a889d --- /dev/null +++ b/anno/NavigationModel.cpp @@ -0,0 +1,45 @@ +#include "NavigationModel.h" + +void NavigationModel::Clear() { + paths_.clear(); + set_current_path({}); + set_can_back(false); + set_can_forward(false); +} + +void NavigationModel::SetPath(const QString & path) { + if (path.isEmpty()) { + return; + } + + while (index_ + 1 < paths_.size()) { + paths_.removeLast(); + } + + paths_ << path; + index_ = paths_.size() - 1; + + set_current_path(path); + set_can_back(index_ > 0); + set_can_forward(false); + +} + +void NavigationModel::Back() { + if (index_ > 0) { + index_--; + set_current_path(paths_[index_]); + set_can_back(index_ > 0); + set_can_forward(true); + } +} + +void NavigationModel::Forward() { + if (index_ + 1 < paths_.size()) { + index_++; + set_current_path(paths_[index_]); + set_can_back(true); + set_can_forward(index_ + 1 < paths_.size()); + } +} + diff --git a/anno/NavigationModel.h b/anno/NavigationModel.h new file mode 100644 index 0000000..ec208a3 --- /dev/null +++ b/anno/NavigationModel.h @@ -0,0 +1,46 @@ +#pragma once +#include "implement_q_property.h" + +class NavigationModel : public QObject { + Q_OBJECT + +public: + NavigationModel(QObject *parent) {} + ~NavigationModel() {} + + Q_PROPERTY(QString current_path READ get_current_path WRITE set_current_path NOTIFY current_path_changed); + Q_PROPERTY(bool can_back READ get_can_back WRITE set_can_back NOTIFY can_back_changed); + Q_PROPERTY(bool can_forward READ get_can_forward WRITE set_can_forward NOTIFY can_forward_changed); + + void SetPath(const QString & path); + +signals: + void current_path_changed(QString); + void can_back_changed(bool); + void can_forward_changed(bool); + +public slots: + void Back(); + void Forward(); + void Clear(); + +private: + IMPLEMENT_Q_PROPERTY_WRITE(QString, current_path); + IMPLEMENT_Q_PROPERTY_WRITE(bool, can_back); + IMPLEMENT_Q_PROPERTY_WRITE(bool, can_forward); + +private: + QString current_path_; + + bool can_back_ = false; + bool can_forward_ = false; + + int index_ = 0; + + QStringList paths_; + +public: + IMPLEMENT_Q_PROPERTY_READ(current_path); + IMPLEMENT_Q_PROPERTY_READ(can_back); + IMPLEMENT_Q_PROPERTY_READ(can_forward); +}; \ No newline at end of file diff --git a/anno/NavigationWidget.cpp b/anno/NavigationWidget.cpp index bdd01c7..6fa2feb 100644 --- a/anno/NavigationWidget.cpp +++ b/anno/NavigationWidget.cpp @@ -2,9 +2,21 @@ // 2020-2024 (c) urobots GmbH, https://urobots.io/en/portfolio/anno/ #include "NavigationWidget.h" -NavigationWidget::NavigationWidget(QWidget *parent) - : QWidget(parent) { +NavigationWidget::NavigationWidget(NavigationModel *model, QWidget *parent) + : QWidget(parent) + , model_(model) +{ ui.setupUi(this); + + connect(model_, &NavigationModel::current_path_changed, ui.filename_lineEdit, &QLineEdit::setText); + connect(model_, &NavigationModel::can_back_changed, ui.back_toolButton, &QToolButton::setEnabled); + connect(model_, &NavigationModel::can_forward_changed, ui.forward_toolButton, &QToolButton::setEnabled); + + connect(ui.back_toolButton, &QToolButton::clicked, model_, &NavigationModel::Back); + connect(ui.forward_toolButton, &QToolButton::clicked, model_, &NavigationModel::Forward); + + ui.back_toolButton->setEnabled(false); + ui.forward_toolButton->setEnabled(false); } NavigationWidget::~NavigationWidget() { diff --git a/anno/NavigationWidget.h b/anno/NavigationWidget.h index 0f77029..1ef2abb 100644 --- a/anno/NavigationWidget.h +++ b/anno/NavigationWidget.h @@ -1,4 +1,5 @@ #pragma once +#include "NavigationModel.h" #include "ui_NavigationWidget.h" #include @@ -8,7 +9,7 @@ class NavigationWidget : public QWidget Q_OBJECT public: - NavigationWidget(QWidget *parent = nullptr); + NavigationWidget(NavigationModel *model, QWidget *parent = nullptr); ~NavigationWidget(); signals: @@ -18,4 +19,5 @@ public slots: private: Ui::NavigationWidget ui; + NavigationModel *model_; }; diff --git a/anno/SourcePicturesTreeModel.cpp b/anno/SourcePicturesTreeModel.cpp index bd652a3..5c7bcba 100644 --- a/anno/SourcePicturesTreeModel.cpp +++ b/anno/SourcePicturesTreeModel.cpp @@ -152,6 +152,42 @@ QVariant SourcePicturesTreeModel::headerData(int section, Qt::Orientation orient return QVariant(); } +QModelIndex SourcePicturesTreeModel::index(QString path) { + auto parts = path.split('/'); + + // search for the element startig from files + int child_index = 0; + FileTreeElement *child = root_->children[0]; + FileTreeElement *parent = nullptr; + + QModelIndex modelIndex = GetFilesRootIndex(); + + for (auto s : parts) { + parent = child; + child = nullptr; + child_index = -1; + + for (size_t t = 0; t < parent->children.size(); ++t) { + if (parent->children[t]->name == s) { + child_index = int(t); + child = parent->children[t]; + modelIndex = createIndex(t, 0, child); + break; + } + } + + if (!child) + break; + } + + if (child) { + return modelIndex; + } + else { + return QModelIndex(); + } +} + QModelIndex SourcePicturesTreeModel::index(int row, int column, const QModelIndex &parent) const { if (!hasIndex(row, column, parent)) return QModelIndex(); diff --git a/anno/SourcePicturesTreeModel.h b/anno/SourcePicturesTreeModel.h index c09566d..58e516c 100644 --- a/anno/SourcePicturesTreeModel.h +++ b/anno/SourcePicturesTreeModel.h @@ -43,6 +43,8 @@ class SourcePicturesTreeModel : public QAbstractItemModel int rowCount(const QModelIndex &parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = QModelIndex()) const override; + QModelIndex index(QString path); + std::shared_ptr GetFileModel(const QModelIndex &); FileTreeItemInfo GetFileInfo(const QModelIndex &); @@ -105,7 +107,7 @@ public slots: int objects_to_copy_count_; int copied_objects_count_; QProgressDialog* current_progress_dialog_; - bool completely_loaded_ = false; + bool completely_loaded_ = false; }; diff --git a/anno/SourcePicturesWidget.cpp b/anno/SourcePicturesWidget.cpp index 4dfa5b3..917c028 100644 --- a/anno/SourcePicturesWidget.cpp +++ b/anno/SourcePicturesWidget.cpp @@ -66,6 +66,9 @@ void SourcePicturesWidget::Init(ApplicationModel *model) { folder_menu_->addSeparator(); delete_folder_action_ = AddAction(folder_menu_, "delete.ico", tr("Delete folder"), &SourcePicturesWidget::OnDeleteFile); AddAction(folder_menu_, "clean.ico", tr("Remove markers"), &SourcePicturesWidget::OnRemoveMarkers); + + + connect(model_->get_navigation_model(), &NavigationModel::current_path_changed, this, &SourcePicturesWidget::OnNavigationPathChanged); } SourcePicturesWidget::~SourcePicturesWidget() @@ -103,13 +106,41 @@ void SourcePicturesWidget::OnTextFilterChanged() { #endif } +void SourcePicturesWidget::OnNavigationPathChanged(QString path) { + if (!is_tree_callback_) { + is_navigation_callback_ = true; + + auto index = tree_model_->index(path); + if (index.isValid()) { + ui.treeView->setCurrentIndex(sort_filter_model_->mapFromSource(index)); + } + + is_navigation_callback_ = false; + } +} + void SourcePicturesWidget::OnCurrentChanged(const QModelIndex ¤t, const QModelIndex &previous) { Q_UNUSED(previous) if (tree_model_) { - emit FileModelSelected(tree_model_->GetFileModel(sort_filter_model_->mapToSource(current))); + auto index = sort_filter_model_->mapToSource(current); + auto file_info = tree_model_->GetFileInfo(index); + auto file = tree_model_->GetFileModel(index); + emit FileModelSelected(file); + + if (!is_navigation_callback_) { + is_tree_callback_ = true; + model_->get_navigation_model()->SetPath(file_info.name); + is_tree_callback_ = false; + } } else { emit FileModelSelected({}); + + if (!is_navigation_callback_) { + is_tree_callback_ = true; + model_->get_navigation_model()->SetPath({}); + is_tree_callback_ = false; + } } } @@ -159,8 +190,9 @@ void SourcePicturesWidget::SelectFile(int offset) { // xxx next_index = model->root_path_index_.child(0, 0); } - if (next_index.isValid()) + if (next_index.isValid()) { ui.treeView->setCurrentIndex(next_index); + } } void SourcePicturesWidget::SelectNextFile() { diff --git a/anno/SourcePicturesWidget.h b/anno/SourcePicturesWidget.h index 97cf0c0..cf0c472 100644 --- a/anno/SourcePicturesWidget.h +++ b/anno/SourcePicturesWidget.h @@ -29,6 +29,8 @@ public slots: void OnRemoveMarkers(); void OnCreateFolder(); + void OnNavigationPathChanged(QString); + private: void SelectFile(int offset); @@ -56,4 +58,7 @@ private slots: QAction *delete_folder_action_ = nullptr; QAction *rename_folder_action_ = nullptr; QAction *remove_markers_in_folder_action_ = nullptr; + + bool is_navigation_callback_ = false; + bool is_tree_callback_ = false; }; diff --git a/anno/anno.vcxproj b/anno/anno.vcxproj index c2cac45..e5207cd 100644 --- a/anno/anno.vcxproj +++ b/anno/anno.vcxproj @@ -190,6 +190,9 @@ xcopy /E /D /Y /I $(OPENCV_BIN_DIR)\opencv_imgcodecs$(OPENCV_VER).dll "$(OutDir) true + + true + true @@ -298,6 +301,9 @@ xcopy /E /D /Y /I $(OPENCV_BIN_DIR)\opencv_imgcodecs$(OPENCV_VER).dll "$(OutDir) true + + true + true @@ -355,6 +361,7 @@ xcopy /E /D /Y /I $(OPENCV_BIN_DIR)\opencv_imgcodecs$(OPENCV_VER).dll "$(OutDir) + @@ -550,6 +557,16 @@ xcopy /E /D /Y /I $(OPENCV_BIN_DIR)\opencv_imgcodecs$(OPENCV_VER).dll "$(OutDir) .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../%(Filename)%(Extension)" -DANNO_USE_OPENCV -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DNDEBUG -DQT_SCRIPT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_WINEXTRAS_LIB -DQT_WIDGETS_LIB -DQT_QML_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I$(ProjectDir).." "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(OPENCV_DIR)\include" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\IlmImf" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\Half" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\Iex" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\Imath" "-I$(QTDIR)\include\QtScript" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtWinExtras" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtQml" + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../%(Filename)%(Extension)" -DANNO_USE_OPENCV -DUNICODE -DWIN32 -DWIN64 -DQT_SCRIPT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_WINEXTRAS_LIB -DQT_WIDGETS_LIB -DQT_QML_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I$(ProjectDir).." "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(OPENCV_DIR)\include" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\IlmImf" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\Half" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\Iex" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\Imath" "-I$(QTDIR)\include\QtScript" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtWinExtras" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtQml" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../%(Filename)%(Extension)" -DANNO_USE_OPENCV -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DNDEBUG -DQT_SCRIPT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_WINEXTRAS_LIB -DQT_WIDGETS_LIB -DQT_QML_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I$(ProjectDir).." "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(OPENCV_DIR)\include" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\IlmImf" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\Half" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\Iex" "-I$(OPENCV_DIR)\..\..\opencv\3rdparty\openexr\Imath" "-I$(QTDIR)\include\QtScript" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtWinExtras" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtQml" + diff --git a/anno/anno.vcxproj.filters b/anno/anno.vcxproj.filters index c8c5d36..961f01c 100644 --- a/anno/anno.vcxproj.filters +++ b/anno/anno.vcxproj.filters @@ -570,6 +570,15 @@ Source Files\UI + + Source Files + + + Generated Files\Debug + + + Generated Files\Release + @@ -955,6 +964,9 @@ Header Files\UI + + Header Files + From 65e94ef12b53beb4ac0c8261294bb059bd9a3460 Mon Sep 17 00:00:00 2001 From: "alexey.pavlov" Date: Wed, 21 Feb 2024 16:31:36 +0100 Subject: [PATCH 05/11] Limit navigation with 100 entries --- anno/NavigationModel.cpp | 4 ++++ anno/SourcePicturesTreeModel.cpp | 7 ++----- anno/product_info.h | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/anno/NavigationModel.cpp b/anno/NavigationModel.cpp index a6a889d..1f349b0 100644 --- a/anno/NavigationModel.cpp +++ b/anno/NavigationModel.cpp @@ -16,6 +16,10 @@ void NavigationModel::SetPath(const QString & path) { paths_.removeLast(); } + while (paths_.size() > 100) { + paths_.removeFirst(); + } + paths_ << path; index_ = paths_.size() - 1; diff --git a/anno/SourcePicturesTreeModel.cpp b/anno/SourcePicturesTreeModel.cpp index 5c7bcba..2396a57 100644 --- a/anno/SourcePicturesTreeModel.cpp +++ b/anno/SourcePicturesTreeModel.cpp @@ -160,8 +160,6 @@ QModelIndex SourcePicturesTreeModel::index(QString path) { FileTreeElement *child = root_->children[0]; FileTreeElement *parent = nullptr; - QModelIndex modelIndex = GetFilesRootIndex(); - for (auto s : parts) { parent = child; child = nullptr; @@ -170,8 +168,7 @@ QModelIndex SourcePicturesTreeModel::index(QString path) { for (size_t t = 0; t < parent->children.size(); ++t) { if (parent->children[t]->name == s) { child_index = int(t); - child = parent->children[t]; - modelIndex = createIndex(t, 0, child); + child = parent->children[t]; break; } } @@ -181,7 +178,7 @@ QModelIndex SourcePicturesTreeModel::index(QString path) { } if (child) { - return modelIndex; + return createIndex(child_index, 0, child); } else { return QModelIndex(); diff --git a/anno/product_info.h b/anno/product_info.h index a5cef66..e8d9fd5 100644 --- a/anno/product_info.h +++ b/anno/product_info.h @@ -3,8 +3,8 @@ #define ANNO_PRODUCT_NAME "anno" #define ANNO_PRODUCT_VERSION_MAJOR 1 -#define ANNO_PRODUCT_VERSION_MINOR 12 -#define ANNO_PRODUCT_VERSION_MAINTENANCE 1 +#define ANNO_PRODUCT_VERSION_MINOR 13 +#define ANNO_PRODUCT_VERSION_MAINTENANCE 0 #define ANNO_PRODUCT_VERSION_BUILD 0 #define ANNO_PRODUCT_VERSION ANNO_PRODUCT_VERSION_MAJOR,ANNO_PRODUCT_VERSION_MINOR,ANNO_PRODUCT_VERSION_MAINTENANCE,ANNO_PRODUCT_VERSION_BUILD From 1cab079a66f891d649b8581dca9e054d78916647 Mon Sep 17 00:00:00 2001 From: "alexey.pavlov" Date: Wed, 21 Feb 2024 16:40:15 +0100 Subject: [PATCH 06/11] qt creator build fixed --- anno/NavigationModel.h | 4 +- anno/anno.pro | 188 +++++++++++++++++++++++++++++++++-------- 2 files changed, 156 insertions(+), 36 deletions(-) diff --git a/anno/NavigationModel.h b/anno/NavigationModel.h index ec208a3..bf5cbfe 100644 --- a/anno/NavigationModel.h +++ b/anno/NavigationModel.h @@ -5,7 +5,7 @@ class NavigationModel : public QObject { Q_OBJECT public: - NavigationModel(QObject *parent) {} + NavigationModel(QObject *parent) : QObject(parent) {} ~NavigationModel() {} Q_PROPERTY(QString current_path READ get_current_path WRITE set_current_path NOTIFY current_path_changed); @@ -43,4 +43,4 @@ public slots: IMPLEMENT_Q_PROPERTY_READ(current_path); IMPLEMENT_Q_PROPERTY_READ(can_back); IMPLEMENT_Q_PROPERTY_READ(can_forward); -}; \ No newline at end of file +}; diff --git a/anno/anno.pro b/anno/anno.pro index b5adbaf..e60ca35 100644 --- a/anno/anno.pro +++ b/anno/anno.pro @@ -32,28 +32,76 @@ PRE_TARGETDEPS += git_rev #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ - AboutDialog.cpp ApplicationModel.cpp CircleLabel.cpp ColorDisplayWidget.cpp CreateLabelFileModelCommand.cpp \ + AboutDialog.cpp \ + ApplicationModel.cpp \ + CircleLabel.cpp ColorDisplayWidget.cpp \ + CreateLabelFileModelCommand.cpp \ CustomPropertiesEditorTableItemDelegate.cpp \ CustomPropertiesEditorTableModel.cpp \ - CustomPropertyTableItemDelegate.cpp CustomPropertyTableModel.cpp DeleteAllLabelsFileModelCommand.cpp \ - DeleteLabelFileModelCommand.cpp Desktop3dWindow.cpp DesktopWidget.cpp ElidedLabelWidget.cpp ErrorsListDialog.cpp FileModel.cpp Highlighter.cpp \ - FileTreeElement.cpp FilenamesEditorWidget.cpp \ - ImageLoader.cpp ImageModel.cpp ImageSettingsWidgetQt.cpp Label.cpp LabelCategory.cpp LabelDefinition.cpp LabelDefinitionPropertiesWidget.cpp \ + CustomPropertyTableItemDelegate.cpp \ + CustomPropertyTableModel.cpp \ + DeleteAllLabelsFileModelCommand.cpp \ + DeleteLabelFileModelCommand.cpp \ + Desktop3dWindow.cpp DesktopWidget.cpp \ + ElidedLabelWidget.cpp ErrorsListDialog.cpp \ + FileModel.cpp \ + Highlighter.cpp \ + FileTreeElement.cpp \ + FilenamesEditorWidget.cpp \ + ImageLoader.cpp ImageModel.cpp \ + ImageSettingsWidgetQt.cpp Label.cpp \ + LabelCategory.cpp \ + LabelDefinition.cpp \ + LabelDefinitionPropertiesWidget.cpp \ ImagePropertiesTableModel.cpp \ ImagePropertiesWidget.cpp \ ImageModelQt.cpp \ LabelDefinitionPropertiesDialog.cpp \ - LabelDefinitionsTreeModel.cpp LabelHandle.cpp LabelPropertiesWidget.cpp LocalFilesystem.cpp main.cpp \ - MainWindow.cpp messagebox.cpp ModifyLabelCategoryFileModelCommand.cpp ModifyLabelGeometryFileModelCommand.cpp \ - ModifyLabelTextFileModelCommand.cpp OrientedCircleLabel.cpp OrientedPointLabel.cpp OrientedRectLabel.cpp PointCloudDisplayWidget.cpp \ - PointLabel.cpp PolygonLabel.cpp PolylineLabel.cpp ProjectDefinitionsDialog.cpp ProjectSettingsWidget.cpp \ - PropertyTableModel.cpp PropertyTableItemDelegate.cpp \ - PropertyDatabase.cpp qjson_helpers.cpp RecentActionsList.cpp RectLabel.cpp rest.cpp \ - RestDatasetFilesystem.cpp SharedPropertiesEditorTableModel.cpp ScriptPainter.cpp settings.cpp SourcePicturesTreeModel.cpp \ + LabelDefinitionsTreeModel.cpp \ + LabelHandle.cpp \ + LabelPropertiesWidget.cpp \ + LocalFilesystem.cpp \ + main.cpp \ + MainWindow.cpp messagebox.cpp \ + ModifyLabelCategoryFileModelCommand.cpp \ + ModifyLabelGeometryFileModelCommand.cpp \ + ModifyLabelTextFileModelCommand.cpp \ + NavigationModel.cpp \ + NavigationWidget.cpp \ + OrientedCircleLabel.cpp \ + OrientedPointLabel.cpp OrientedRectLabel.cpp \ + PointCloudDisplayWidget.cpp \ + PointLabel.cpp \ + PolygonLabel.cpp \ + PolylineLabel.cpp \ + ProjectDefinitionsDialog.cpp \ + ProjectSettingsWidget.cpp \ + PropertyTableModel.cpp \ + PropertyTableItemDelegate.cpp \ + PropertyDatabase.cpp \ + qjson_helpers.cpp \ + RecentActionsList.cpp \ + RectLabel.cpp \ + rest.cpp \ + RestDatasetFilesystem.cpp \ + SharedPropertiesEditorTableModel.cpp \ + ScriptPainter.cpp \ + settings.cpp \ + SourcePicturesTreeModel.cpp \ StartupDialog.cpp \ - stdafx.cpp Serialization.cpp StampPropertiesEditorTableModel.cpp \ - SourcePicturesWidget.cpp ToolLabel.cpp ToolboxProxyModel.cpp ToolboxWidget.cpp win_helpers.cpp \ - triangulation/construct.c triangulation/misc.c triangulation/monotone.c triangulation/tri.c triangulation/xtime.c + stdafx.cpp \ + Serialization.cpp \ + StampPropertiesEditorTableModel.cpp \ + SourcePicturesWidget.cpp \ + ToolLabel.cpp \ + ToolboxProxyModel.cpp \ + ToolboxWidget.cpp \ + win_helpers.cpp \ + triangulation/construct.c \ + triangulation/misc.c \ + triangulation/monotone.c \ + triangulation/tri.c \ + triangulation/xtime.c HEADERS += \ CustomPropertiesEditorTableItemDelegate.h \ @@ -61,34 +109,106 @@ HEADERS += \ ImagePropertiesWidget.h \ LabelDefinitionPropertiesDialog.h \ StartupDialog.h \ - AboutDialog.h ApplicationModel.h ArcBall.h CircleLabel.h ColorDisplayWidget.h ColoredVertexData.h \ + AboutDialog.h \ + ApplicationModel.h \ + ArcBall.h \ + CircleLabel.h \ + ColorDisplayWidget.h \ + ColoredVertexData.h \ ColorTransformer.h \ CustomPropertiesEditorTableModel.h \ - CreateLabelFileModelCommand.h CustomProperty.h CustomPropertyTableItemDelegate.h CustomPropertyTableModel.h \ - DeleteAllLabelsFileModelCommand.h DeleteLabelFileModelCommand.h Desktop3dWindow.h DesktopWidget.h ElidedLabelWidget.h ErrorsListDialog.h \ + CreateLabelFileModelCommand.h \ + CustomProperty.h \ + CustomPropertyTableItemDelegate.h \ + CustomPropertyTableModel.h \ + DeleteAllLabelsFileModelCommand.h \ + DeleteLabelFileModelCommand.h \ + Desktop3dWindow.h \ + DesktopWidget.h \ + ElidedLabelWidget.h \ + ErrorsListDialog.h \ FilenamesEditorWidget.h \ - FileModel.h FilesystemInterface.h FileTreeItemInfo.h geometry.h Highlighter.h ImageConverter.h ImageData.h ImageLoader.h \ + FileModel.h \ + FilesystemInterface.h \ + FileTreeItemInfo.h \ + geometry.h \ + Highlighter.h \ + ImageConverter.h \ + ImageData.h \ + ImageLoader.h \ FileTreeElement.h \ - ImageModel.h ImageSettingsWidgetQt.h implement_q_property.h Label.h LabelCategory.h LabelDefinition.h LabelDefinitionPropertiesWidget.h \ - LabelDefinitionsTreeModel.h LabelFactory.h LabelHandle.h LabelPropertiesWidget.h LabelType.h LocalFilesystem.h \ - MainWindow.h messagebox.h ModifyLabelCategoryFileModelCommand.h ModifyLabelGeometryFileModelCommand.h \ - ModifyLabelTextFileModelCommand.h OrientedCircleLabel.h OrientedPointLabel.h OrientedRectLabel.h PaintInfo.h PointCloudDisplayShaders.h \ - PointCloudDisplayWidget.h PointLabel.h PolygonLabel.h PolylineLabel.h ProjectDefinitionsDialog.h ProjectSettingsWidget.h \ - PropertyDatabase.h ProxyLabel.h qjson_helpers.h RecentActionsList.h RectLabel.h rest.h RestDatasetFilesystem.h \ - PropertyTableModel.h PropertyTableItemDelegate.h \ - ScriptPainter.h settings.h SharedPropertyDefinition.h SharedPropertiesEditorTableModel.h SourcePicturesTreeModel.h SourcePicturesWidget.h \ + ImageModel.h \ + ImageSettingsWidgetQt.h \ + implement_q_property.h \ + Label.h \ + LabelCategory.h \ + LabelDefinition.h \ + LabelDefinitionPropertiesWidget.h \ + LabelDefinitionsTreeModel.h \ + LabelFactory.h \ + LabelHandle.h \ + LabelPropertiesWidget.h \ + LabelType.h \ + LocalFilesystem.h \ + MainWindow.h \ + messagebox.h \ + ModifyLabelCategoryFileModelCommand.h \ + ModifyLabelGeometryFileModelCommand.h \ + ModifyLabelTextFileModelCommand.h \ + NavigationModel.h \ + NavigationWidget.h \ + OrientedCircleLabel.h \ + OrientedPointLabel.h \ + OrientedRectLabel.h \ + PaintInfo.h \ + PointCloudDisplayShaders.h \ + PointCloudDisplayWidget.h \ + PointLabel.h \ + PolygonLabel.h \ + PolylineLabel.h \ + ProjectDefinitionsDialog.h \ + ProjectSettingsWidget.h \ + PropertyDatabase.h \ + ProxyLabel.h \ + qjson_helpers.h \ + RecentActionsList.h \ + RectLabel.h rest.h \ + RestDatasetFilesystem.h \ + PropertyTableModel.h \ + PropertyTableItemDelegate.h \ + ScriptPainter.h \ + settings.h SharedPropertyDefinition.h \ + SharedPropertiesEditorTableModel.h \ + SourcePicturesTreeModel.h \ + SourcePicturesWidget.h \ migration_helpers.h \ - stdafx.h Serialization.h StampPropertiesEditorTableModel.h \ - ToolboxProxyModel.h ToolboxWidget.h ToolLabel.h win_helpers.h WorldInfo.h \ - triangulation/xtime.c triangulation/interface.h triangulation/triangulate.h triangulation/xtime.h + stdafx.h \ + Serialization.h \ + StampPropertiesEditorTableModel.h \ + ToolboxProxyModel.h \ + ToolboxWidget.h \ + ToolLabel.h win_helpers.h\ + WorldInfo.h \ + triangulation/xtime.c \ + triangulation/interface.h \ + triangulation/triangulate.h \ + triangulation/xtime.h FORMS += \ - AboutDialog.ui Desktop3dWindow.ui \ - ErrorsListDialog.ui ImageSettingsWidgetQt.ui LabelDefinitionPropertiesWidget.ui \ + AboutDialog.ui \ + Desktop3dWindow.ui \ + ErrorsListDialog.ui \ + ImageSettingsWidgetQt.ui \ + LabelDefinitionPropertiesWidget.ui \ ImagePropertiesWidget.ui \ LabelDefinitionPropertiesDialog.ui \ - LabelPropertiesWidget.ui MainWindow.ui ProjectDefinitionsDialog.ui \ - ProjectSettingsWidget.ui SourcePicturesWidget.ui ToolboxWidget.ui \ + LabelPropertiesWidget.ui \ + MainWindow.ui \ + NavigationWidget.ui \ + ProjectDefinitionsDialog.ui \ + ProjectSettingsWidget.ui \ + SourcePicturesWidget.ui \ + ToolboxWidget.ui \ StartupDialog.ui RESOURCES += MainWindow.qrc From 56e3256794eb6c952a792ce0f751ad5033dbb9e5 Mon Sep 17 00:00:00 2001 From: "alexey.pavlov" Date: Wed, 21 Feb 2024 16:47:09 +0100 Subject: [PATCH 07/11] remove filename at the bottom of the desktop --- anno/MainWindow.cpp | 2 -- anno/MainWindow.ui | 29 ++++++++--------------------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/anno/MainWindow.cpp b/anno/MainWindow.cpp index c0434ea..ca7df6a 100644 --- a/anno/MainWindow.cpp +++ b/anno/MainWindow.cpp @@ -451,8 +451,6 @@ void MainWindow::OnImageFileChanged(std::shared_ptr value) { connect(ui.undo_action, &QAction::triggered, stack, &QUndoStack::undo); connect(ui.redo_action, &QAction::triggered, stack, &QUndoStack::redo); } - - ui.desktop_status_label->setText(selected_file_ ? selected_file_->get_id() : QString()); } void MainWindow::CanUndoChanged(bool value) { diff --git a/anno/MainWindow.ui b/anno/MainWindow.ui index dd73a5f..8c6f171 100644 --- a/anno/MainWindow.ui +++ b/anno/MainWindow.ui @@ -184,30 +184,17 @@ - - - - 16777215 - 15 - - - - QFrame::Raised - + - Qt::Vertical + Qt::Horizontal - - - - - - - 0 - 0 - + + + 40 + 20 + - + From ae377cf5983cc3db206a8e858d11e3669a48b8c3 Mon Sep 17 00:00:00 2001 From: Alexey Pavlov Date: Wed, 21 Feb 2024 22:09:41 +0100 Subject: [PATCH 08/11] fix mac build --- anno/NavigationModel.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/anno/NavigationModel.h b/anno/NavigationModel.h index bf5cbfe..71e5064 100644 --- a/anno/NavigationModel.h +++ b/anno/NavigationModel.h @@ -1,4 +1,6 @@ #pragma once +#include +#include #include "implement_q_property.h" class NavigationModel : public QObject { From 2b364439734c8051778a10ebfa9e9aacc14d3c94 Mon Sep 17 00:00:00 2001 From: Alexey Pavlov Date: Wed, 21 Feb 2024 22:20:34 +0100 Subject: [PATCH 09/11] show path starting from '/', support selection of the root element ('Files') --- anno/SourcePicturesTreeModel.cpp | 4 ++++ anno/SourcePicturesWidget.cpp | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/anno/SourcePicturesTreeModel.cpp b/anno/SourcePicturesTreeModel.cpp index 2396a57..14f4bb5 100644 --- a/anno/SourcePicturesTreeModel.cpp +++ b/anno/SourcePicturesTreeModel.cpp @@ -153,6 +153,10 @@ QVariant SourcePicturesTreeModel::headerData(int section, Qt::Orientation orient } QModelIndex SourcePicturesTreeModel::index(QString path) { + if (path.isEmpty()) { + return GetFilesRootIndex(); + } + auto parts = path.split('/'); // search for the element startig from files diff --git a/anno/SourcePicturesWidget.cpp b/anno/SourcePicturesWidget.cpp index 917c028..fe82b51 100644 --- a/anno/SourcePicturesWidget.cpp +++ b/anno/SourcePicturesWidget.cpp @@ -110,6 +110,10 @@ void SourcePicturesWidget::OnNavigationPathChanged(QString path) { if (!is_tree_callback_) { is_navigation_callback_ = true; + if (!path.isEmpty() && path[0] == '/') { + path.removeAt(0); + } + auto index = tree_model_->index(path); if (index.isValid()) { ui.treeView->setCurrentIndex(sort_filter_model_->mapFromSource(index)); @@ -129,7 +133,7 @@ void SourcePicturesWidget::OnCurrentChanged(const QModelIndex ¤t, const QM if (!is_navigation_callback_) { is_tree_callback_ = true; - model_->get_navigation_model()->SetPath(file_info.name); + model_->get_navigation_model()->SetPath("/" + file_info.name); is_tree_callback_ = false; } } @@ -138,7 +142,7 @@ void SourcePicturesWidget::OnCurrentChanged(const QModelIndex ¤t, const QM if (!is_navigation_callback_) { is_tree_callback_ = true; - model_->get_navigation_model()->SetPath({}); + model_->get_navigation_model()->SetPath("/"); is_tree_callback_ = false; } } From f9ebf8b051554b76338da0f1ebdd90b8377e1172 Mon Sep 17 00:00:00 2001 From: "alexey.pavlov" Date: Wed, 21 Feb 2024 22:27:17 +0100 Subject: [PATCH 10/11] fix qt5 build --- anno/SourcePicturesWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anno/SourcePicturesWidget.cpp b/anno/SourcePicturesWidget.cpp index fe82b51..7ef10b6 100644 --- a/anno/SourcePicturesWidget.cpp +++ b/anno/SourcePicturesWidget.cpp @@ -111,7 +111,7 @@ void SourcePicturesWidget::OnNavigationPathChanged(QString path) { is_navigation_callback_ = true; if (!path.isEmpty() && path[0] == '/') { - path.removeAt(0); + path.remove(0, 1); } auto index = tree_model_->index(path); From 13faad6b1a1635d22ff97457763f3e541d2a65fb Mon Sep 17 00:00:00 2001 From: "alexey.pavlov" Date: Wed, 21 Feb 2024 22:27:28 +0100 Subject: [PATCH 11/11] version bump --- anno/product_info.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anno/product_info.h b/anno/product_info.h index e8d9fd5..8cfc36e 100644 --- a/anno/product_info.h +++ b/anno/product_info.h @@ -4,7 +4,7 @@ #define ANNO_PRODUCT_VERSION_MAJOR 1 #define ANNO_PRODUCT_VERSION_MINOR 13 -#define ANNO_PRODUCT_VERSION_MAINTENANCE 0 +#define ANNO_PRODUCT_VERSION_MAINTENANCE 1 #define ANNO_PRODUCT_VERSION_BUILD 0 #define ANNO_PRODUCT_VERSION ANNO_PRODUCT_VERSION_MAJOR,ANNO_PRODUCT_VERSION_MINOR,ANNO_PRODUCT_VERSION_MAINTENANCE,ANNO_PRODUCT_VERSION_BUILD