1 #include "MatchToolNewPointDialog.h" 5 #include <QAbstractItemView> 10 #include <QListWidget> 11 #include <QPushButton> 47 QLabel *ptIdLabel =
new QLabel(
"Point ID:");
48 ptIdLineEdit =
new QLineEdit;
49 ptIdLineEdit->setText(defaultPointId);
50 ptIdLineEdit->selectAll();
51 ptIdLabel->setBuddy(ptIdLineEdit);
52 connect(ptIdLineEdit, SIGNAL(textChanged(
const QString &)),
55 QLabel *listLabel =
new QLabel(
"Displayed Cubes / Selected measures: \n" 56 "Right click on the cube viewport to select approximate measure " 57 "location.\nCubes will be highlighted below as you select " 58 "measure locations.");
60 m_fileList =
new QListWidget;
61 m_fileList->setSelectionMode(QAbstractItemView::NoSelection);
64 m_doneButton =
new QPushButton(
"Done selecting measures");
65 m_doneButton->setToolTip(
"All measures have been selected. Load the new point into the " 66 "control point editor for refinement.");
67 m_doneButton->setWhatsThis(
"You have right-clicked on all cube viewports you want to create " 68 "as a control measure. The new point will be loaded into the " 69 "control point editor for refinement.");
72 if (defaultPointId.isEmpty() || cnet.
ContainsPoint(defaultPointId)) {
73 m_doneButton->setEnabled(
false);
75 QPushButton *cancelButton =
new QPushButton(
"Cancel");
76 cancelButton->setToolTip(
"Cancel without creating a new point.");
77 QHBoxLayout *buttonLayout =
new QHBoxLayout;
78 buttonLayout->addWidget(m_doneButton);
79 buttonLayout->addWidget(cancelButton);
81 connect(m_doneButton, SIGNAL(clicked()),
this, SLOT(accept()));
82 connect(m_doneButton, SIGNAL(clicked()),
this, SIGNAL(measuresFinished()));
84 connect(cancelButton, SIGNAL(clicked()),
this, SLOT(reject()));
85 connect(cancelButton, SIGNAL(clicked()),
this, SIGNAL(newPointCanceled()));
87 QHBoxLayout *ptIdLayout =
new QHBoxLayout;
88 ptIdLayout->addWidget(ptIdLabel);
89 ptIdLayout->addWidget(ptIdLineEdit);
91 QVBoxLayout *vLayout =
new QVBoxLayout;
92 vLayout->addLayout(ptIdLayout);
93 vLayout->addWidget(listLabel);
94 vLayout->addWidget(m_fileList);
95 vLayout->addLayout(buttonLayout);
98 setWindowTitle(
"Create New ControlPoint");
113 m_fileList->addItems(pointFiles);
119 void MatchToolNewPointDialog::highlightFile(QString file) {
122 if (!found.isEmpty()) {
123 m_fileList->setSelectionMode(QAbstractItemView::ExtendedSelection);
124 found.at(0)->setSelected(
true);
125 m_fileList->setSelectionMode(QAbstractItemView::NoSelection);
131 QString MatchToolNewPointDialog::pointId()
const {
132 return ptIdLineEdit->text();
145 m_doneButton->setEnabled(!text.isEmpty());
bool ContainsPoint(QString pointId) const
Namespace for ISIS/Bullet specific routines.