Loading isis/src/qisis/objs/JigsawSetupDialog/JigsawSetupDialog.cpp +32 −2 Original line number Diff line number Diff line Loading @@ -3,8 +3,10 @@ #include <vector> #include <QDebug> #include <QIdentityProxyModel> #include <QMessageBox> #include <QPushButton> #include <QSortFilterProxyModel> #include <QStandardItemModel> #include "BundleSolutionInfo.h" Loading @@ -13,7 +15,9 @@ #include "Control.h" #include "IString.h" #include "MaximumLikelihoodWFunctions.h" #include "ObservationSolveSettingsProxyModel.h" #include "Project.h" #include "ProjectItemProxyModel.h" #include "SpecialPixel.h" #include "ui_JigsawSetupDialog.h" Loading Loading @@ -87,6 +91,7 @@ namespace Isis { // Update setup dialog with settings from any active (current) settings in jigsaw dialog. // initializations for observation solve settings tab createObservationSolveSettingsTreeView(); m_ui->spkSolveDegreeSpinBox_2->setValue(-1); QStringList tableHeaders; Loading Loading @@ -520,7 +525,6 @@ namespace Isis { } } } // target body // ensure user entered something to adjust if (m_ui->poleRaCheckBox->isChecked() || Loading Loading @@ -636,7 +640,7 @@ namespace Isis { /** * Loads the passed bundle settings into the setup dialog. This is used by JigsawRunWidget to * Loads the passed bundle settings into the setup dialog. This is used by JigsawDialog to * load its current settings when not using the last (most recent) bundle settings in the project. * * @param const BundleSettingsQsp settings Shared pointer to the settings to load up. Loading Loading @@ -1121,4 +1125,30 @@ namespace Isis { FileName fname = arg1; m_ui->outputControlNet->setText(fname.baseName() + "-out.net"); } void JigsawSetupDialog::createObservationSolveSettingsTreeView() { // Proof-of-concept // m_ui->treeView->setModel((QAbstractItemModel*)(m_project->directory()->model())); ProjectItemModel *model = m_project->directory()->model(); SubTreeProxyModel *osspm = new SubTreeProxyModel; osspm->setSourceModel(model); // find the root "Images" and set it in the proxy QStandardItem *item = model->invisibleRootItem()->child(0)->child(1); qDebug() << "ITEM: " << item << ", " << item->text(); qDebug() << "PARENT: " << item->parent() << ", " << item->parent()->text(); // i think source model tries to add top root item, which is invalid??? osspm->setRoot(item); m_ui->treeView->setModel(osspm); // Try to loop through the view here to add the "groups" so they aren't part of the model // Add apply button to the tab view // set the text to bold? } } isis/src/qisis/objs/JigsawSetupDialog/JigsawSetupDialog.h +2 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,8 @@ namespace Isis { void showTargetParametersGroupBox(); void hideTargetParametersGroupBox(); void createObservationSolveSettingsTreeView(); private: Ui::JigsawSetupDialog *m_ui; Project *m_project; Loading isis/src/qisis/objs/JigsawSetupDialog/JigsawSetupDialog.ui +18 −11 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ </sizepolicy> </property> <property name="currentIndex"> <number>0</number> <number>1</number> </property> <widget class="QWidget" name="generalSettingsTab"> <attribute name="title"> Loading Loading @@ -954,18 +954,25 @@ <zorder>twistCheckBox_2</zorder> </widget> </item> <item row="0" column="0"> <spacer name="horizontalSpacer"> <property name="orientation"> <enum>Qt::Horizontal</enum> <item row="2" column="1"> <widget class="QPushButton" name="pushButton"> <property name="text"> <string>Apply Settings to Selected Images</string> </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> </size> </widget> </item> <item row="0" column="0" rowspan="3"> <widget class="QTreeView" name="treeView"> <property name="editTriggers"> <set>QAbstractItemView::NoEditTriggers</set> </property> </spacer> <property name="selectionMode"> <enum>QAbstractItemView::ExtendedSelection</enum> </property> <property name="headerHidden"> <bool>true</bool> </property> </widget> </item> </layout> </widget> Loading isis/src/qisis/objs/ProjectItemImageProxyModel/ProjectItemImageProxyModel.cpp 0 → 100644 +33 −0 Original line number Diff line number Diff line #include "ProjectItemImageProxyModel.h" #include <QModelIndex> #include <QObject> #include <QSortFilterProxyModel> #include "ProjectItem.h" namespace Isis { ProjectItemImageProxyModel::ProjectItemImageProxyModel(QObject *parent) : QSortFilterProxyModel(parent) { } bool ProjectItemImageProxyModel::filterAcceptsColumn(int sourceColumn, const QModelIndex &sourceParent) const { } bool ProjectItemImageProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const { ProjectItemModel *source = static_cast<ProjectItemModel *>(sourceModel()); QModelIndex modelIndex = source->index(sourceRow, 0, sourceParent); ProjectItem *item = source->itemFromIndex(modelIndex); if (item->isImage() || item->isImageList()) { return true; } return false; } } isis/src/qisis/objs/ProjectItemImageProxyModel/ProjectItemImageProxyModel.h 0 → 100644 +21 −0 Original line number Diff line number Diff line #ifndef ProjectItemImageProxyModel_h #define ProjectItemImageProxyModel_h #include <QSortFilterProxyModel> namespace Isis { class ProjectItemImageProxyModel : public QSortFilterProxyModel { public: ProjectItemImageProxyModel(QObject *parent = NULL); ~ProjectItemImageProxyModel(); protected: virtual bool filterAcceptsColumn(int sourceColumn, const QModelIndex &sourceParent) const override; virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; }; } #endif Loading
isis/src/qisis/objs/JigsawSetupDialog/JigsawSetupDialog.cpp +32 −2 Original line number Diff line number Diff line Loading @@ -3,8 +3,10 @@ #include <vector> #include <QDebug> #include <QIdentityProxyModel> #include <QMessageBox> #include <QPushButton> #include <QSortFilterProxyModel> #include <QStandardItemModel> #include "BundleSolutionInfo.h" Loading @@ -13,7 +15,9 @@ #include "Control.h" #include "IString.h" #include "MaximumLikelihoodWFunctions.h" #include "ObservationSolveSettingsProxyModel.h" #include "Project.h" #include "ProjectItemProxyModel.h" #include "SpecialPixel.h" #include "ui_JigsawSetupDialog.h" Loading Loading @@ -87,6 +91,7 @@ namespace Isis { // Update setup dialog with settings from any active (current) settings in jigsaw dialog. // initializations for observation solve settings tab createObservationSolveSettingsTreeView(); m_ui->spkSolveDegreeSpinBox_2->setValue(-1); QStringList tableHeaders; Loading Loading @@ -520,7 +525,6 @@ namespace Isis { } } } // target body // ensure user entered something to adjust if (m_ui->poleRaCheckBox->isChecked() || Loading Loading @@ -636,7 +640,7 @@ namespace Isis { /** * Loads the passed bundle settings into the setup dialog. This is used by JigsawRunWidget to * Loads the passed bundle settings into the setup dialog. This is used by JigsawDialog to * load its current settings when not using the last (most recent) bundle settings in the project. * * @param const BundleSettingsQsp settings Shared pointer to the settings to load up. Loading Loading @@ -1121,4 +1125,30 @@ namespace Isis { FileName fname = arg1; m_ui->outputControlNet->setText(fname.baseName() + "-out.net"); } void JigsawSetupDialog::createObservationSolveSettingsTreeView() { // Proof-of-concept // m_ui->treeView->setModel((QAbstractItemModel*)(m_project->directory()->model())); ProjectItemModel *model = m_project->directory()->model(); SubTreeProxyModel *osspm = new SubTreeProxyModel; osspm->setSourceModel(model); // find the root "Images" and set it in the proxy QStandardItem *item = model->invisibleRootItem()->child(0)->child(1); qDebug() << "ITEM: " << item << ", " << item->text(); qDebug() << "PARENT: " << item->parent() << ", " << item->parent()->text(); // i think source model tries to add top root item, which is invalid??? osspm->setRoot(item); m_ui->treeView->setModel(osspm); // Try to loop through the view here to add the "groups" so they aren't part of the model // Add apply button to the tab view // set the text to bold? } }
isis/src/qisis/objs/JigsawSetupDialog/JigsawSetupDialog.h +2 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,8 @@ namespace Isis { void showTargetParametersGroupBox(); void hideTargetParametersGroupBox(); void createObservationSolveSettingsTreeView(); private: Ui::JigsawSetupDialog *m_ui; Project *m_project; Loading
isis/src/qisis/objs/JigsawSetupDialog/JigsawSetupDialog.ui +18 −11 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ </sizepolicy> </property> <property name="currentIndex"> <number>0</number> <number>1</number> </property> <widget class="QWidget" name="generalSettingsTab"> <attribute name="title"> Loading Loading @@ -954,18 +954,25 @@ <zorder>twistCheckBox_2</zorder> </widget> </item> <item row="0" column="0"> <spacer name="horizontalSpacer"> <property name="orientation"> <enum>Qt::Horizontal</enum> <item row="2" column="1"> <widget class="QPushButton" name="pushButton"> <property name="text"> <string>Apply Settings to Selected Images</string> </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> </size> </widget> </item> <item row="0" column="0" rowspan="3"> <widget class="QTreeView" name="treeView"> <property name="editTriggers"> <set>QAbstractItemView::NoEditTriggers</set> </property> </spacer> <property name="selectionMode"> <enum>QAbstractItemView::ExtendedSelection</enum> </property> <property name="headerHidden"> <bool>true</bool> </property> </widget> </item> </layout> </widget> Loading
isis/src/qisis/objs/ProjectItemImageProxyModel/ProjectItemImageProxyModel.cpp 0 → 100644 +33 −0 Original line number Diff line number Diff line #include "ProjectItemImageProxyModel.h" #include <QModelIndex> #include <QObject> #include <QSortFilterProxyModel> #include "ProjectItem.h" namespace Isis { ProjectItemImageProxyModel::ProjectItemImageProxyModel(QObject *parent) : QSortFilterProxyModel(parent) { } bool ProjectItemImageProxyModel::filterAcceptsColumn(int sourceColumn, const QModelIndex &sourceParent) const { } bool ProjectItemImageProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const { ProjectItemModel *source = static_cast<ProjectItemModel *>(sourceModel()); QModelIndex modelIndex = source->index(sourceRow, 0, sourceParent); ProjectItem *item = source->itemFromIndex(modelIndex); if (item->isImage() || item->isImageList()) { return true; } return false; } }
isis/src/qisis/objs/ProjectItemImageProxyModel/ProjectItemImageProxyModel.h 0 → 100644 +21 −0 Original line number Diff line number Diff line #ifndef ProjectItemImageProxyModel_h #define ProjectItemImageProxyModel_h #include <QSortFilterProxyModel> namespace Isis { class ProjectItemImageProxyModel : public QSortFilterProxyModel { public: ProjectItemImageProxyModel(QObject *parent = NULL); ~ProjectItemImageProxyModel(); protected: virtual bool filterAcceptsColumn(int sourceColumn, const QModelIndex &sourceParent) const override; virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; }; } #endif