Loading isis/src/qisis/objs/JigsawSetupDialog/JigsawSetupDialog.cpp +56 −3 Original line number Diff line number Diff line Loading @@ -3,9 +3,12 @@ #include <vector> #include <QDebug> #include <QIdentityProxyModel> #include <QMessageBox> #include <QPushButton> #include <QSortFilterProxyModel> #include <QStandardItemModel> #include <QItemSelection> #include "BundleSolutionInfo.h" #include "BundleSettings.h" Loading @@ -14,7 +17,10 @@ #include "IString.h" #include "MaximumLikelihoodWFunctions.h" #include "Project.h" #include "ProjectItem.h" #include "ProjectItemProxyModel.h" #include "SpecialPixel.h" #include "SubTreeProxyModel.h" #include "ui_JigsawSetupDialog.h" namespace Isis { Loading Loading @@ -47,6 +53,11 @@ namespace Isis { makeReadOnly(); } //connect( m_project->directory()->model(), SIGNAL(selectionChanged(QList<ProjectItem *> &)), // this, SLOT(on_projectItemSelectionChanged(const QList<ProjectItem *> &) ) ); // initializations for general tab // fill control net combo box from project Loading Loading @@ -87,7 +98,9 @@ namespace Isis { // Update setup dialog with settings from any active (current) settings in jigsaw dialog. // initializations for observation solve settings tab // m_ui->spkSolveDegreeSpinsBox_2->setValue(-1); createObservationSolveSettingsTreeView(); m_ui->spkSolveDegreeSpinBox_2->setValue(-1); QStringList tableHeaders; tableHeaders << "coefficients" << "a priori sigma" << "units"; Loading Loading @@ -215,6 +228,7 @@ namespace Isis { } JigsawSetupDialog::~JigsawSetupDialog() { // delete/null m_ui since we did "new" this pointers in the constructor if (m_ui) { Loading Loading @@ -571,7 +585,6 @@ namespace Isis { } } } // target body // ensure user entered something to adjust if (m_ui->poleRaCheckBox->isChecked() || Loading Loading @@ -687,7 +700,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 @@ -1297,4 +1310,44 @@ namespace Isis { FileName fname = arg1; m_ui->outputControlNetLineEdit->setText(fname.baseName() + "-out.net"); } void JigsawSetupDialog::createObservationSolveSettingsTreeView() { // Proof-of- QList<ProjectItem *> selectedItems = m_project->directory()->model()->selectedItems(); foreach(ProjectItem *item,selectedItems){ qDebug() << "Selected Item: " << item->text(); } qDebug() << "JigsawSetupDialog::createObservationSolveSettingsTreeView()"; // m_ui->treeView->setModel((QAbstractItemModel*)(m_project->directory()->model())); ProjectItemModel *model = m_project->directory()->model(); SubTreeProxyModel *osspm = new SubTreeProxyModel; osspm->setSourceModel(model); //QModelIndex SubTreeProxyModel::mapFromSource(const QModelIndex &sourceIndex) // 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??? m_ui->treeView->setModel(osspm); //Set the root index to display the subtree we are interested in. This requires //computing the proxy index from the source model. if (selectedItems.count() > 0) { m_ui->treeView->setRootIndex(osspm->mapFromSource(selectedItems[0]->index() )); } } } isis/src/qisis/objs/JigsawSetupDialog/JigsawSetupDialog.h +7 −0 Original line number Diff line number Diff line Loading @@ -9,8 +9,12 @@ namespace Ui { class JigsawSetupDialog; } class QItemSelection; namespace Isis { class Project; class ProjectItem; class Control; /** Loading Loading @@ -83,6 +87,7 @@ namespace Isis { private slots: void on_pointRadiusSigmaCheckBox_toggled(bool checked); //void on_projectItemSelectionChanged(const QList<ProjectItem *> selectedItems); //void on_outlierRejectionCheckBox_toggled(bool checked); // general tab Loading Loading @@ -138,6 +143,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 @@ -1478,18 +1478,25 @@ Valid Range: 1.0e-10 to 1.0e+10</string> <zorder>twistCheckBox</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 +56 −3 Original line number Diff line number Diff line Loading @@ -3,9 +3,12 @@ #include <vector> #include <QDebug> #include <QIdentityProxyModel> #include <QMessageBox> #include <QPushButton> #include <QSortFilterProxyModel> #include <QStandardItemModel> #include <QItemSelection> #include "BundleSolutionInfo.h" #include "BundleSettings.h" Loading @@ -14,7 +17,10 @@ #include "IString.h" #include "MaximumLikelihoodWFunctions.h" #include "Project.h" #include "ProjectItem.h" #include "ProjectItemProxyModel.h" #include "SpecialPixel.h" #include "SubTreeProxyModel.h" #include "ui_JigsawSetupDialog.h" namespace Isis { Loading Loading @@ -47,6 +53,11 @@ namespace Isis { makeReadOnly(); } //connect( m_project->directory()->model(), SIGNAL(selectionChanged(QList<ProjectItem *> &)), // this, SLOT(on_projectItemSelectionChanged(const QList<ProjectItem *> &) ) ); // initializations for general tab // fill control net combo box from project Loading Loading @@ -87,7 +98,9 @@ namespace Isis { // Update setup dialog with settings from any active (current) settings in jigsaw dialog. // initializations for observation solve settings tab // m_ui->spkSolveDegreeSpinsBox_2->setValue(-1); createObservationSolveSettingsTreeView(); m_ui->spkSolveDegreeSpinBox_2->setValue(-1); QStringList tableHeaders; tableHeaders << "coefficients" << "a priori sigma" << "units"; Loading Loading @@ -215,6 +228,7 @@ namespace Isis { } JigsawSetupDialog::~JigsawSetupDialog() { // delete/null m_ui since we did "new" this pointers in the constructor if (m_ui) { Loading Loading @@ -571,7 +585,6 @@ namespace Isis { } } } // target body // ensure user entered something to adjust if (m_ui->poleRaCheckBox->isChecked() || Loading Loading @@ -687,7 +700,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 @@ -1297,4 +1310,44 @@ namespace Isis { FileName fname = arg1; m_ui->outputControlNetLineEdit->setText(fname.baseName() + "-out.net"); } void JigsawSetupDialog::createObservationSolveSettingsTreeView() { // Proof-of- QList<ProjectItem *> selectedItems = m_project->directory()->model()->selectedItems(); foreach(ProjectItem *item,selectedItems){ qDebug() << "Selected Item: " << item->text(); } qDebug() << "JigsawSetupDialog::createObservationSolveSettingsTreeView()"; // m_ui->treeView->setModel((QAbstractItemModel*)(m_project->directory()->model())); ProjectItemModel *model = m_project->directory()->model(); SubTreeProxyModel *osspm = new SubTreeProxyModel; osspm->setSourceModel(model); //QModelIndex SubTreeProxyModel::mapFromSource(const QModelIndex &sourceIndex) // 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??? m_ui->treeView->setModel(osspm); //Set the root index to display the subtree we are interested in. This requires //computing the proxy index from the source model. if (selectedItems.count() > 0) { m_ui->treeView->setRootIndex(osspm->mapFromSource(selectedItems[0]->index() )); } } }
isis/src/qisis/objs/JigsawSetupDialog/JigsawSetupDialog.h +7 −0 Original line number Diff line number Diff line Loading @@ -9,8 +9,12 @@ namespace Ui { class JigsawSetupDialog; } class QItemSelection; namespace Isis { class Project; class ProjectItem; class Control; /** Loading Loading @@ -83,6 +87,7 @@ namespace Isis { private slots: void on_pointRadiusSigmaCheckBox_toggled(bool checked); //void on_projectItemSelectionChanged(const QList<ProjectItem *> selectedItems); //void on_outlierRejectionCheckBox_toggled(bool checked); // general tab Loading Loading @@ -138,6 +143,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 @@ -1478,18 +1478,25 @@ Valid Range: 1.0e-10 to 1.0e+10</string> <zorder>twistCheckBox</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