File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
CnetEditorWidget.cpp
1 
7 /* SPDX-License-Identifier: CC0-1.0 */
8 
9 #include "IsisDebug.h"
10 
11 #include "CnetEditorWidget.h"
12 
13 #include <QAction>
14 #include <QApplication>
15 #include <QBoxLayout>
16 #include <QByteArray>
17 #include <QCloseEvent>
18 #include <QDebug>
19 #include <QGroupBox>
20 #include <QHBoxLayout>
21 #include <QHeaderView>
22 #include <QItemSelection>
23 #include <QMenu>
24 #include <QMessageBox>
25 #include <QModelIndex>
26 #include <QScrollArea>
27 #include <QScrollBar>
28 #include <QSettings>
29 #include <QSplitter>
30 #include <QString>
31 #include <QStringList>
32 #include <QTime>
33 #include <QTimer>
34 #include <QToolBar>
35 #include <QVBoxLayout>
36 #include <QWhatsThis>
37 #include <QtXml>
38 
39 #include "AbstractMeasureItem.h"
40 #include "AbstractPointItem.h"
41 #include "AbstractTreeItem.h"
42 #include "CnetDisplayProperties.h"
43 #include "CnetEditorSortConfigDialog.h"
44 #include "Control.h"
45 #include "ControlMeasure.h"
46 #include "ControlNet.h"
47 #include "ControlPoint.h"
48 #include "FileName.h"
49 #include "FilterWidget.h"
50 #include "IException.h"
51 #include "ImageImageTreeModel.h"
52 #include "ImagePointTreeModel.h"
53 #include "MeasureTableModel.h"
54 #include "PointMeasureTreeModel.h"
55 #include "PointTableModel.h"
56 #include "Project.h"
57 #include "TableView.h"
58 #include "TableViewHeader.h"
59 #include "TreeView.h"
60 #include "XmlStackedHandler.h"
61 #include "XmlStackedHandlerReader.h"
62 
63 
64 namespace Isis {
65 
66 //**************************************************************
67 //**************************************************************
68 //**************************************************************
69 
70  const QString CnetEditorWidget::VERSION = "0.1";
71 
72 //**************************************************************
73 //**************************************************************
74 //**************************************************************
75 
76 
77  CnetEditorWidget::CnetEditorWidget(Control *control, QString pathForSettings) {
78  nullify();
79 
80  m_workingVersion = new QString;
83 
84  m_updatingSelection = false;
85 
86  m_sortDialog = NULL;
87 
89  connect(CnetDisplayProperties::getInstance(), SIGNAL(compositionFinished()),
90  this, SLOT(rebuildModels()));
91 
92  connect(this, SIGNAL(cnetModified()), this, SLOT(setCnetModified()));
93  m_settingsPath = new QString(pathForSettings);
94 
95  QBoxLayout *mainLayout = createMainLayout();
96  setLayout(mainLayout);
97 
98  createActions();
99 
100  readSettings();
101 
102  upgradeVersion();
103 
104  installEventFilter(this);
105  }
106 
107 
112 
113  writeSettings();
114 
115  delete m_workingVersion;
116  m_workingVersion = NULL;
117 
118  delete m_settingsPath;
119  m_settingsPath = NULL;
120 
121  delete m_pointTreeView;
122  m_pointTreeView = NULL;
123 
124  delete m_imageTreeView;
125  m_imageTreeView = NULL;
126 
127  delete m_connectionTreeView;
128  m_connectionTreeView = NULL;
129 
130  delete m_pointTableView;
131  m_pointTableView = NULL;
132 
133  delete m_measureTableView;
134  m_measureTableView = NULL;
135 
136  delete m_pointFilterWidget;
137  m_pointFilterWidget = NULL;
138 
139  delete m_serialFilterWidget;
140  m_serialFilterWidget = NULL;
141 
144 
145  delete m_menuActions;
146  m_menuActions = NULL;
147 
148  delete m_toolBarActions;
149  m_toolBarActions = NULL;
150 
151  m_pointTableBox = NULL;
152  m_measureTableBox = NULL;
153  m_mainSplitter = NULL;
154 
155  // TODO: null all member widgets!
156 
157  delete m_pointModel;
158  m_pointModel = NULL;
159 
160  delete m_imageModel;
161  m_imageModel = NULL;
162 
163  delete m_connectionModel;
164  m_connectionModel = NULL;
165 
166  delete m_sortDialog;
167  m_sortDialog = NULL;
168  }
169 
170 
175  m_pointTreeView = NULL;
176  m_imageTreeView = NULL;
177  m_connectionTreeView = NULL;
178 
179  m_pointModel = NULL;
180  m_imageModel = NULL;
181  m_connectionModel = NULL;
182 
183  m_pointTableModel = NULL;
184  m_measureTableModel = NULL;
185 
186  m_pointTableBox = NULL;
187  m_measureTableBox = NULL;
188 
189  m_pointTableView = NULL;
190  m_measureTableView = NULL;
191 
192  m_mainSplitter = NULL;
193 
194  m_menuActions = NULL;
195  m_toolBarActions = NULL;
196 
197  m_filterArea = NULL;
198 
199  m_pointFilterWidget = NULL;
200  m_serialFilterWidget = NULL;
202 
203  m_control = NULL;
204  m_settingsPath = NULL;
205  m_workingVersion = NULL;
206 
207  m_sortDialog = NULL;
208  }
209 
210 
217  m_pointModel->stopWorking();
218  m_imageModel->stopWorking();
219  m_connectionModel->stopWorking();
220 
221  bool ignoreAll = false;
222  foreach (AbstractTreeItem * item, itemsToDelete) {
223  try {
224  item->deleteSource();
225  }
226  catch (IException &e) {
227  QString message = e.what();
228 
229  if (!ignoreAll) {
230  if (item == itemsToDelete.last()) {
231  QMessageBox::warning(
232  this, "Failed to delete row", message, QMessageBox::Ok);
233  }
234  else {
235  message += "\n\nOkay to continue?";
236 
237  QMessageBox::StandardButton status = QMessageBox::warning(
238  this, "Failed to delete row", message, QMessageBox::Yes |
239  QMessageBox::YesToAll | QMessageBox::No);
240 
241  if (status == QMessageBox::YesToAll)
242  ignoreAll = true;
243  else if (status == QMessageBox::No)
244  break;
245  }
246  }
247  }
248  }
249 
250  m_pointModel->rebuildItems();
251  m_imageModel->rebuildItems();
252  m_connectionModel->rebuildItems();
253  }
254 
255 
263 
264  connect(m_pointTreeView, SIGNAL(activated()),
265  m_imageTreeView, SLOT(deactivate()));
266  connect(m_pointTreeView, SIGNAL(activated()),
267  m_connectionTreeView, SLOT(deactivate()));
268 
269  connect(m_imageTreeView, SIGNAL(activated()),
270  m_pointTreeView, SLOT(deactivate()));
271  connect(m_imageTreeView, SIGNAL(activated()),
272  m_connectionTreeView, SLOT(deactivate()));
273 
274  connect(m_connectionTreeView, SIGNAL(activated()),
275  m_pointTreeView, SLOT(deactivate()));
276  connect(m_connectionTreeView, SIGNAL(activated()),
277  m_imageTreeView, SLOT(deactivate()));
278 
280 
282  m_pointTableBox = new QGroupBox(tr("Control Point Table"));
283  QHBoxLayout *pointTableLayout = new QHBoxLayout;
284  pointTableLayout->addWidget(m_pointTableView);
285  m_pointTableBox->setLayout(pointTableLayout);
286 
288  m_measureTableBox = new QGroupBox(tr("Control Measure Table"));
289  QHBoxLayout *measureTableLayout = new QHBoxLayout;
290  measureTableLayout->addWidget(m_measureTableView);
291  m_measureTableBox->setLayout(measureTableLayout);
292 
293  m_mainSplitter = new QSplitter(Qt::Vertical);
294  m_mainSplitter->addWidget(m_pointTableBox);
295  m_mainSplitter->addWidget(m_measureTableBox);
296 
297  QBoxLayout *mainLayout = new QHBoxLayout;
298  mainLayout->addWidget(m_mainSplitter);
299 
300  return mainLayout;
301  }
302 
303 
308  ASSERT(m_menuActions);
309 
310  QAction *freezeTablesAct = new QAction(QIcon(
311  FileName("$ISISROOT/appdata/images/icons/ice.png").expanded()),
312  tr("&Freeze Tables"), this);
313  freezeTablesAct->setCheckable(true);
314  freezeTablesAct->setToolTip(tr("Freeze tables (filters will not take "
315  "effect until unfrozen)"));
316  freezeTablesAct->setStatusTip(tr("Freeze tables (filters will not take "
317  "effect until unfrozen)"));
318  freezeTablesAct->setWhatsThis(tr("<html>When frozen, the contents of the "
319  "tables will be locked. Current filters will not be applied to the "
320  "tables until they are unfrozen.</html>"));
321  connect(freezeTablesAct, SIGNAL(toggled(bool)),
322  this, SLOT(setTablesFrozen(bool)));
323  QList< QString > freezeTablesLocation;
324  freezeTablesLocation.append(tr("&Tables"));
325  m_menuActions->insert(freezeTablesAct, freezeTablesLocation);
326 
327  QAction *configureSortAct = new QAction(QIcon(
328  FileName("$ISISROOT/appdata/images/icons/sort.png").expanded()),
329  tr("&Sorting Options..."), this);
330  QString configureSortToolTipText = tr("Configure table sorting options");
331  configureSortAct->setToolTip(configureSortToolTipText);
332  configureSortAct->setStatusTip(configureSortToolTipText);
333  configureSortAct->setWhatsThis(tr("<html>Click here to configure options "
334  "related to the sorting of table columns.</html>"));
335  connect(configureSortAct, SIGNAL(triggered()),
336  this, SLOT(configSorting()));
337  QList< QString > configureSortLocation;
338  configureSortLocation.append(tr("&Tables"));
339  m_menuActions->insert(configureSortAct, configureSortLocation);
340 
341  QAction *whatsThisAct = QWhatsThis::createAction(this);
342  QList< QString > whatsThisLocation;
343  whatsThisLocation.append(tr("&Help"));
344  m_menuActions->insert(whatsThisAct, whatsThisLocation);
345 
346  QList< QAction * > tbActionList;
347  tbActionList.append(freezeTablesAct);
348  tbActionList.append(configureSortAct);
349  m_toolBarActions->insert("settingsToolBar", tbActionList);
350  }
351 
352 
357  m_pointTreeView = new TreeView();
358  m_pointTreeView->setTitle("Point View");
360  m_pointTreeView->setModel(m_pointModel);
361  }
362 
363 
368  m_imageTreeView = new TreeView();
369  m_imageTreeView->setTitle("Cube View");
371  m_imageTreeView->setModel(m_imageModel);
372  }
373 
374 
380  m_connectionTreeView->setTitle("Cube Connection View");
383  }
384 
385 
390  ASSERT(m_pointModel);
391  ASSERT(m_imageModel);
392  ASSERT(m_connectionModel);
393 
394  FilterWidget *pointFilter = new FilterWidget("Points and Measures");
395  if (m_pointModel) {
396  m_pointModel->setFilter(pointFilter);
397  }
398 
399  QHBoxLayout *pointFilterLayout = new QHBoxLayout;
400  pointFilterLayout->addWidget(pointFilter);
401  QWidget *pointArea = new QWidget;
402  pointArea->setLayout(pointFilterLayout);
403  QScrollArea *pointFilterScrollArea = new QScrollArea;
404  pointFilterScrollArea->setWidget(pointArea);
405  pointFilterScrollArea->setWidgetResizable(true);
406  m_pointFilterWidget = pointFilterScrollArea;
407 
408  FilterWidget *serialFilter = new FilterWidget("Images and Points");
409  if (m_imageModel) {
410  m_imageModel->setFilter(serialFilter);
411  }
412 
413  QHBoxLayout *serialFilterLayout = new QHBoxLayout;
414  serialFilterLayout->addWidget(serialFilter);
415  QWidget *serialArea = new QWidget;
416  serialArea->setLayout(serialFilterLayout);
417  QScrollArea *serialFilterScrollArea = new QScrollArea;
418  serialFilterScrollArea->setWidget(serialArea);
419  serialFilterScrollArea->setWidgetResizable(true);
420  m_serialFilterWidget = serialFilterScrollArea;
421 
422  FilterWidget *connectionFilter = new FilterWidget("Connections");
423  if (m_connectionModel) {
424  m_connectionModel->setFilter(connectionFilter);
425  }
426 
427  QHBoxLayout *connectionFilterLayout = new QHBoxLayout;
428  connectionFilterLayout->addWidget(connectionFilter);
429  QWidget *connectionArea = new QWidget;
430  connectionArea->setLayout(connectionFilterLayout);
431  QScrollArea *connectionFilterScrollArea = new QScrollArea;
432  connectionFilterScrollArea->setWidget(connectionArea);
433  connectionFilterScrollArea->setWidgetResizable(true);
434  m_connectionFilterWidget = connectionFilterScrollArea;
435  }
436 
437 
444  "m_pointTableView");
445  m_pointTableView->setWhatsThis("<html>Each row in the table is a control "
446  "point. Each column in the table is an attribute of a control "
447  "point.<br/><br/>Cells that are gray are not editable.</html>");
448  connect(m_pointTableView, SIGNAL(modelDataChanged()),
449  this, SIGNAL(cnetModified()));
450 
451  connect(m_pointTreeView, SIGNAL(selectionChanged()),
452  m_pointTableView, SLOT(handleModelSelectionChanged()));
453  connect(m_pointTableView, SIGNAL(selectionChanged()),
454  m_pointTreeView, SLOT(handleModelSelectionChanged()));
455 
456  connect(m_pointTableView,
458  this,
460 
461  connect(m_pointTableView, SIGNAL(filterCountsChanged(int, int)),
462  this, SLOT(handlePointTableFilterCountsChanged(int, int)));
463 
464  connect(m_pointTableView, SIGNAL(editControlPoint(ControlPoint *, QString)),
465  this, SIGNAL(editControlPoint(ControlPoint *, QString)));
466 
467  for (int i = 0; i < AbstractPointItem::COLS; i++) {
468  QAction *act = new QAction(
469  AbstractPointItem::getColumnName((AbstractPointItem::Column) i), this);
470  act->setCheckable(true);
471  connect(act, SIGNAL(toggled(bool)), this, SLOT(pointColToggled()));
472  m_pointTableView->getHorizontalHeader()->addAction(act);
473  }
474 
475  m_pointTableView->getHorizontalHeader()->setContextMenuPolicy(
476  Qt::ActionsContextMenu);
477  }
478 
479 
486  "m_measureTableView");
487  m_measureTableView->setWhatsThis("<html>Each row in the table is a control "
488  "measure. Each column in the table is an attribute of a control "
489  "measure.<br/><br/>Rows with bold text are reference measures. "
490  "Cells that are gray are not editable.</html>");
491  ASSERT(m_pointTableView);
492  connect(m_pointTableView,
493  SIGNAL(tableSelectionChanged(QList< AbstractTreeItem * >)),
495  SLOT(handleTreeSelectionChanged(QList<AbstractTreeItem *>)));
496 
497  connect(m_measureTableView,
498  SIGNAL(tableSelectionChanged(QList< AbstractTreeItem * >)),
500  SLOT(handleTreeSelectionChanged(QList< AbstractTreeItem * >)));
501 
502 
503  connect(m_measureTableView, SIGNAL(modelDataChanged()),
504  this, SIGNAL(cnetModified()));
505  connect(m_pointTreeView, SIGNAL(selectionChanged()),
506  m_measureTableView, SLOT(handleModelSelectionChanged()));
507  connect(m_measureTableView, SIGNAL(selectionChanged()),
508  m_pointTreeView, SLOT(handleModelSelectionChanged()));
509  connect(m_measureTableView,
511  this,
513 
514  connect(m_measureTableView, SIGNAL(filterCountsChanged(int, int)),
515  this, SLOT(handleMeasureTableFilterCountsChanged(int, int)));
516 
517  connect(m_measureTableView, SIGNAL(editControlPoint(ControlPoint *, QString)),
518  this, SIGNAL(editControlPoint(ControlPoint *, QString)));
519 
520  for (int i = 0; i < AbstractMeasureItem::COLS; i++) {
521  QAction *act = new QAction(AbstractMeasureItem::getColumnName(
522  (AbstractMeasureItem::Column) i), this);
523  act->setCheckable(true);
524  connect(act, SIGNAL(toggled(bool)), this, SLOT(measureColToggled()));
525  m_measureTableView->getHorizontalHeader()->addAction(act);
526  }
527 
528  m_measureTableView->getHorizontalHeader()->setContextMenuPolicy(
529  Qt::ActionsContextMenu);
530  }
531 
532 
538  }
539 
540 
545  QList< QAction * > actions =
547 
548  for (int i = 0; i < actions.size(); i++) {
549  m_pointTableView->setColumnVisible(actions[i]->text(),
550  actions[i]->isChecked());
551  }
552  }
553 
554 
559  QList< QAction * > actions =
561  for (int i = 0; i < actions.size(); i++)
562  m_measureTableView->setColumnVisible(actions[i]->text(),
563  actions[i]->isChecked());
564  }
565 
566 
577  int visibleRows, int totalRows) {
578  handleTableFilterCountsChanged(visibleRows, totalRows, m_pointTableBox,
579  "Control Point Table");
580  }
581 
582 
593  int visibleRows, int totalRows) {
594  handleTableFilterCountsChanged(visibleRows, totalRows, m_measureTableBox,
595  "Control Measure Table");
596  }
597 
598 
608  int visibleRows, int totalRows, QGroupBox *box, QString initialText) {
609  if (box) {
610  QString newTitle = initialText + " (";
611  if (visibleRows > -1)
612  newTitle += QString::number(visibleRows);
613  else
614  newTitle += "???";
615 
616  newTitle += " / " + QString::number(totalRows) + ")";
617 
618  box->setTitle(newTitle);
619  }
620  }
621 
622 
627  if (*m_workingVersion == "") {
628  *m_workingVersion = "0.1";
629  }
630 
631  if (*m_workingVersion != VERSION)
632  upgradeVersion();
633  }
634 
635 
640  ASSERT(m_workingVersion);
641  ASSERT(m_settingsPath);
642  ASSERT(m_measureTableView);
643 
644  QSettings settings(*m_settingsPath, QSettings::NativeFormat);
645  *m_workingVersion = settings.value("version", "").toString();
646 
647  m_mainSplitter->restoreState(settings.value("mainSplitter").toByteArray());
648 
649  QString key;
650 
651  QList< QAction * > actions =
653  for (int i = 0; i < actions.size(); i++) {
654  key = m_measureTableView->objectName() + " " +
655  AbstractMeasureItem::getColumnName((AbstractMeasureItem::Column) i);
656  key.replace(" ", "_");
657  actions[i]->setChecked(settings.value(key, true).toBool());
658  }
659 
660  actions = m_pointTableView->getHorizontalHeader()->actions();
661  for (int i = 0; i < actions.size(); i++) {
662  key = m_pointTableView->objectName() + " " +
663  AbstractPointItem::getColumnName((AbstractPointItem::Column) i);
664  key.replace(" ", "_");
665  actions[i]->setChecked(settings.value(key, true).toBool());
666  }
667 
668  // Restore sorting configuration settings.
670  settings.value("measureTableSortingEnabled", true).toBool());
672  settings.value("measureTableSortLimit", 500000).toInt());
674  settings.value("pointTableSortingEnabled", true).toBool());
676  settings.value("pointTableSortLimit", 100000).toInt());
677  }
678 
679 
684  ASSERT(m_mainSplitter);
685  ASSERT(m_settingsPath);
686  ASSERT(m_measureTableView);
687 
688  QSettings settings(*m_settingsPath, QSettings::NativeFormat);
689  settings.setValue("version", VERSION);
690  settings.setValue("mainSplitter", m_mainSplitter->saveState());
691 
692  QString key;
693 
694  QList< QAction * > actions =
696  for (int i = 0; i < actions.size(); i++) {
697  key = m_measureTableView->objectName() + " " +
698  AbstractMeasureItem::getColumnName((AbstractMeasureItem::Column) i);
699  key.replace(" ", "_");
700  settings.setValue(key, actions[i]->isChecked());
701  }
702 
703  actions = m_pointTableView->getHorizontalHeader()->actions();
704  for (int i = 0; i < actions.size(); i++) {
705  key = m_pointTableView->objectName() + " " +
706  AbstractPointItem::getColumnName((AbstractPointItem::Column) i);
707  key.replace(" ", "_");
708  settings.setValue(key, actions[i]->isChecked());
709  }
710 
711  // Write sorting configuration settings.
712  settings.setValue("measureTableSortingEnabled",
714  settings.setValue("measureTableSortLimit",
716  settings.setValue("pointTableSortingEnabled",
718  settings.setValue("pointTableSortLimit",
720  }
721 
722 
729  return m_pointTreeView;
730  }
731 
732 
739  return m_imageTreeView;
740  }
741 
742 
749  return m_connectionTreeView;
750  }
751 
752 
759  return m_pointFilterWidget;
760  }
761 
762 
769  return m_serialFilterWidget;
770  }
771 
772 
780  }
781 
782 
789  return m_pointTableView;
790  }
791 
792 
799  return m_measureTableView;
800  }
801 
802 
809  return m_measureTableModel;
810  }
811 
812 
819  return m_pointTableModel;
820  }
821 
822 
829  return m_control->controlNet();
830  }
831 
832 
839  ASSERT(m_menuActions);
840  return *m_menuActions;
841  }
842 
843 
850  ASSERT(m_toolBarActions);
851  return *m_toolBarActions;
852  }
853 
854 
861  ControlNet *filteredCnet = new ControlNet(*(m_control->controlNet()));
862 
863  QList<AbstractTreeItem *> networkItems = m_pointModel->getItems(0, -1,
864  AbstractTreeModel::MeasureItems | AbstractTreeModel::PointItems, true);
865 
866  // Iterate through our copy of the cnet, deleting anything that doesn't
867  // exactly match our networkItems.
868  for (int pointIndex = filteredCnet->GetNumPoints() - 1;
869  pointIndex >= 0;
870  pointIndex--) {
871  if (networkItems.isEmpty()) {
872  ControlPoint *cp = filteredCnet->GetPoint(pointIndex);
873  cp->SetEditLock(false);
874 
875  for (int measureIndex = 0;
876  measureIndex < cp->GetNumMeasures();
877  measureIndex++) {
878  cp->GetMeasure(measureIndex)->SetEditLock(false);
879  }
880 
881  filteredCnet->DeletePoint(cp);
882  }
883  else if (networkItems.last()->getPointerType() ==
884  AbstractTreeItem::Point) {
885  ControlPoint *networkItemsCp =
886  (ControlPoint *)networkItems.last()->getPointer();
887  ControlPoint *cp = filteredCnet->GetPoint(pointIndex);
888  if (cp->GetId() != networkItemsCp->GetId()) {
889  cp->SetEditLock(false);
890 
891  for (int measureIndex = 0;
892  measureIndex < cp->GetNumMeasures();
893  measureIndex++) {
894  cp->GetMeasure(measureIndex)->SetEditLock(false);
895  }
896 
897  filteredCnet->DeletePoint(cp);
898  }
899  else {
900  networkItems.removeLast();
901  }
902  }
903  else if (networkItems.last()->getPointerType() ==
904  AbstractTreeItem::Measure) {
905  ControlPoint *cp = filteredCnet->GetPoint(pointIndex);
906  ControlMeasure *networkItemsCm =
907  (ControlMeasure *)networkItems.last()->getPointer();
908 
909  if (cp->GetId() != networkItemsCm->Parent()->GetId()) {
910  cp->SetEditLock(false);
911 
912  for (int measureIndex = 0;
913  measureIndex < cp->GetNumMeasures();
914  measureIndex++) {
915  cp->GetMeasure(measureIndex)->SetEditLock(false);
916  }
917 
918  filteredCnet->DeletePoint(cp);
919  }
920  else {
921  // Our CP stays, figure out which CMs stay.
922  for (int measureIndex = cp->GetNumMeasures() - 1;
923  networkItemsCm && measureIndex >= 0;
924  measureIndex--) {
925  ControlMeasure *cm = cp->GetMeasure(measureIndex);
926  if (cm->GetCubeSerialNumber() !=
927  networkItemsCm->GetCubeSerialNumber()) {
928  cm->SetEditLock(false);
929  cp->Delete(cm);
930  }
931  else {
932  networkItems.removeLast();
933  networkItemsCm = NULL;
934 
935  if (networkItems.last()->getPointerType() ==
936  AbstractTreeItem::Measure) {
937  networkItemsCm =
938  (ControlMeasure *)networkItems.last()->getPointer();
939  }
940  }
941  }
942 
943  // We still need to verify the copied CP at this index... although
944  // nothing should go wrong, we know things do go wrong so do
945  // the verify instead of just tossing the last networkItems item.
946  pointIndex++;
947  }
948  }
949  }
950 
951  return filteredCnet;
952  }
953 
954 
961  return m_measureTableModel->sortingIsEnabled();
962  }
963 
964 
971  return m_measureTableModel->sortLimit();
972  }
973 
974 
981  return m_pointTableModel->sortingIsEnabled();
982  }
983 
984 
991  return m_pointTableModel->sortLimit();
992  }
993 
994 
1001  m_measureTableModel->setSortingEnabled(enabled);
1002  }
1003 
1004 
1011  m_measureTableModel->setSortLimit(limit);
1012  }
1013 
1014 
1021  m_pointTableModel->setSortingEnabled(enabled);
1022  }
1023 
1024 
1031  m_pointTableModel->setSortLimit(limit);
1032  }
1033 
1034 
1040  if (!m_sortDialog) {
1042  }
1043  m_sortDialog->show();
1044  }
1045 
1046 
1052  void CnetEditorWidget::setTablesFrozen(bool freezeTables) {
1053  if (freezeTables) {
1054  m_connectionModel->setFrozen(true);
1055  m_imageModel->setFrozen(true);
1056  m_pointModel->setFrozen(true);
1057  }
1058  else {
1059  m_pointModel->setFrozen(false);
1060  m_imageModel->setFrozen(false);
1061  m_connectionModel->setFrozen(false);
1062  }
1063  }
1064 
1065 
1070  m_control->setModified(true);
1071  }
1072 }
Isis::CnetEditorWidget::m_updatingSelection
bool m_updatingSelection
Updates selection.
Definition: CnetEditorWidget.h:179
Isis::CnetEditorWidget::~CnetEditorWidget
virtual ~CnetEditorWidget()
Destructor.
Definition: CnetEditorWidget.cpp:111
Isis::CnetEditorWidget::createMeasureTableView
void createMeasureTableView()
Creates the measure table and adds it to the widget.
Definition: CnetEditorWidget.cpp:483
Isis::CnetEditorWidget::m_pointTreeView
TreeView * m_pointTreeView
Point tree view.
Definition: CnetEditorWidget.h:185
QWidget
Isis::CnetEditorWidget::m_serialFilterWidget
QWidget * m_serialFilterWidget
Serial filter widget.
Definition: CnetEditorWidget.h:198
Isis::CnetEditorWidget::pointFilterWidget
QWidget * pointFilterWidget()
Returns the point filter widget.
Definition: CnetEditorWidget.cpp:758
Isis::CnetEditorWidget::serialFilterWidget
QWidget * serialFilterWidget()
Returns the serial filter widget.
Definition: CnetEditorWidget.cpp:768
Isis::CnetEditorWidget::m_connectionFilterWidget
QWidget * m_connectionFilterWidget
Connection filter widget.
Definition: CnetEditorWidget.h:199
Isis::ImagePointTreeModel
Tree model for images and control points.
Definition: ImagePointTreeModel.h:48
Isis::CnetEditorWidget::measureTableModel
AbstractTableModel * measureTableModel()
Returns the measure table model.
Definition: CnetEditorWidget.cpp:808
Isis::ControlPoint::GetMeasure
const ControlMeasure * GetMeasure(QString serialNumber) const
Get a control measure based on its cube's serial number.
Definition: ControlPoint.cpp:416
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
Isis::CnetEditorWidget::measureTableSortingEnabled
bool measureTableSortingEnabled() const
Returns true if the measure table can be sorted.
Definition: CnetEditorWidget.cpp:960
Isis::CnetEditorWidget::setCnetModified
void setCnetModified()
Connected to cnetModified().
Definition: CnetEditorWidget.cpp:1069
Project.h
Isis::CnetEditorWidget::connectionTreeView
QWidget * connectionTreeView()
Returns the connection tree view.
Definition: CnetEditorWidget.cpp:748
Isis::CnetEditorWidget::rebuildModels
void rebuildModels()
Rebuilds the models.
Definition: CnetEditorWidget.cpp:536
Isis::CnetEditorWidget::m_mainSplitter
QSplitter * m_mainSplitter
Splitter.
Definition: CnetEditorWidget.h:208
Isis::TableView::getHorizontalHeader
TableViewHeader * getHorizontalHeader()
Returns the horizontal header.
Definition: TableView.cpp:164
Isis::ControlPoint::SetEditLock
Status SetEditLock(bool editLock)
Set the EditLock state.
Definition: ControlPoint.cpp:522
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::CnetEditorWidget::m_measureTableBox
QGroupBox * m_measureTableBox
Measure table box.
Definition: CnetEditorWidget.h:193
Isis::CnetEditorWidget::m_pointModel
PointMeasureTreeModel * m_pointModel
Point tree model.
Definition: CnetEditorWidget.h:201
Isis::CnetEditorWidget::setPointTableSortingEnabled
void setPointTableSortingEnabled(bool enabled)
Sets if the point table can be sorted.
Definition: CnetEditorWidget.cpp:1020
Isis::ImageImageTreeModel
Tree model for images and images.
Definition: ImageImageTreeModel.h:48
Isis::CnetEditorWidget::createFilterArea
void createFilterArea()
Creates filter widgets.
Definition: CnetEditorWidget.cpp:389
Isis::CnetEditorWidget::control
ControlNet * control()
Returns the control network.
Definition: CnetEditorWidget.cpp:828
Isis::TableView
Definition: TableView.h:43
Isis::CnetEditorWidget::m_menuActions
QMap< QAction *, QList< QString > > * m_menuActions
QMap of menu actions.
Definition: CnetEditorWidget.h:210
Isis::CnetEditorWidget::m_sortDialog
CnetEditorSortConfigDialog * m_sortDialog
Sorting dialog.
Definition: CnetEditorWidget.h:215
Isis::CnetEditorWidget::filteredNetwork
ControlNet * filteredNetwork() const
Returns the filtered control net.
Definition: CnetEditorWidget.cpp:860
Isis::CnetEditorWidget::setMeasureTableSortingEnabled
void setMeasureTableSortingEnabled(bool enabled)
Sets if the measure table can be sorted.
Definition: CnetEditorWidget.cpp:1000
Isis::CnetEditorWidget::m_toolBarActions
QMap< QString, QList< QAction * > > * m_toolBarActions
QMap of tool bar actions.
Definition: CnetEditorWidget.h:211
Isis::ControlPoint::GetId
QString GetId() const
Return the Id of the control point.
Definition: ControlPoint.cpp:1306
Isis::CnetEditorSortConfigDialog
Configure user's sorting settings for the cneteditor widget.
Definition: CnetEditorSortConfigDialog.h:37
Isis::CnetEditorWidget::readSettings
void readSettings()
Reads the working version settings stored at the settings path.
Definition: CnetEditorWidget.cpp:639
Isis::CnetEditorWidget::m_connectionTreeView
TreeView * m_connectionTreeView
Connection tree view.
Definition: CnetEditorWidget.h:187
Isis::CnetEditorWidget::setTablesFrozen
void setTablesFrozen(bool)
Sets if the tables are frozen.
Definition: CnetEditorWidget.cpp:1052
Isis::AbstractTableModel
Translates the tree model into a table model.
Definition: AbstractTableModel.h:48
Isis::CnetEditorWidget::menuActions
QMap< QAction *, QList< QString > > menuActions()
Returns the menu actions.
Definition: CnetEditorWidget.cpp:838
Isis::CnetEditorWidget::m_pointFilterWidget
QWidget * m_pointFilterWidget
Point filter widget.
Definition: CnetEditorWidget.h:197
Isis::IException::what
const char * what() const
Returns a string representation of this exception in its current state.
Definition: IException.cpp:375
Isis::CnetEditorWidget::toolBarActions
QMap< QString, QList< QAction * > > toolBarActions()
Returns the tool bar actions.
Definition: CnetEditorWidget.cpp:849
Isis::CnetEditorWidget::createActions
void createActions()
Creates the menus, and options for the widget.
Definition: CnetEditorWidget.cpp:307
Isis::CnetEditorWidget::createPointTreeView
void createPointTreeView()
Creates the point tree view and adds it to the model.
Definition: CnetEditorWidget.cpp:356
Isis::ControlMeasure::GetCubeSerialNumber
QString GetCubeSerialNumber() const
Return the serial number of the cube containing the coordinate.
Definition: ControlMeasure.cpp:557
Isis::CnetEditorWidget::setMeasureTableSortLimit
void setMeasureTableSortLimit(int limit)
Sets the measure table sorting limit.
Definition: CnetEditorWidget.cpp:1010
Isis::CnetEditorWidget::createPointTableView
void createPointTableView()
Creates the point table and adds it to the widget.
Definition: CnetEditorWidget.cpp:441
Isis::ControlPoint
A single control point.
Definition: ControlPoint.h:354
Isis::CnetEditorWidget::nullify
void nullify()
Sets all member variables to NULL.
Definition: CnetEditorWidget.cpp:174
Isis::CnetEditorWidget::m_pointTableBox
QGroupBox * m_pointTableBox
Point table box.
Definition: CnetEditorWidget.h:192
Isis::ControlNet::GetNumPoints
int GetNumPoints() const
Return the number of control points in the network.
Definition: ControlNet.cpp:1465
Isis::Control::controlNet
ControlNet * controlNet()
Open and return a pointer to the ControlNet for this Control.
Definition: Control.cpp:150
Isis::CnetEditorWidget::createConnectionTreeView
void createConnectionTreeView()
Creates the connection tree and adds it to the model.
Definition: CnetEditorWidget.cpp:378
Isis::CnetEditorWidget::handleTableFilterCountsChanged
void handleTableFilterCountsChanged(int visibleRows, int totalRows, QGroupBox *box, QString initialText)
Handles any table filter changes.
Definition: CnetEditorWidget.cpp:607
Isis::CnetEditorWidget::m_imageTreeView
TreeView * m_imageTreeView
Image tree view.
Definition: CnetEditorWidget.h:186
Isis::CnetEditorWidget::m_measureTableView
TableView * m_measureTableView
Measure table view.
Definition: CnetEditorWidget.h:190
Isis::CnetEditorWidget::createMainLayout
QBoxLayout * createMainLayout()
Creates the layout of the widget.
Definition: CnetEditorWidget.cpp:259
Isis::CnetEditorWidget::pointTableModel
AbstractTableModel * pointTableModel()
Returns the point table model.
Definition: CnetEditorWidget.cpp:818
Isis::CnetEditorWidget::measureTableView
TableView * measureTableView()
Returns the measure table view.
Definition: CnetEditorWidget.cpp:798
Isis::CnetEditorWidget::m_filterArea
QScrollArea * m_filterArea
Scroll area for filters.
Definition: CnetEditorWidget.h:195
Isis::CnetEditorWidget::m_pointTableModel
PointTableModel * m_pointTableModel
Point table model.
Definition: CnetEditorWidget.h:205
Isis::CnetEditorWidget::writeSettings
void writeSettings()
Writes the configuration settings used.
Definition: CnetEditorWidget.cpp:683
Isis::Control::setModified
void setModified(bool modified=true)
@description Sets the modification state of this control.
Definition: Control.cpp:241
Isis::TableView::setColumnVisible
void setColumnVisible(QString, bool)
Sets the specified column visible or invisible.
Definition: TableView.cpp:175
Isis::ControlNet
a control network
Definition: ControlNet.h:257
Isis::CnetEditorWidget::m_workingVersion
QString * m_workingVersion
Working version.
Definition: CnetEditorWidget.h:181
Isis::CnetEditorWidget::connectionFilterWidget
QWidget * connectionFilterWidget()
Returns the connection filter widget.
Definition: CnetEditorWidget.cpp:778
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::CnetEditorWidget::VERSION
static const QString VERSION
Version.
Definition: CnetEditorWidget.h:182
Isis::CnetEditorWidget::pointTableSortingEnabled
bool pointTableSortingEnabled() const
Returns true if the point table can be sorted.
Definition: CnetEditorWidget.cpp:980
Isis::CnetEditorWidget::pointTableView
TableView * pointTableView()
Returns the point table view.
Definition: CnetEditorWidget.cpp:788
Isis::CnetEditorWidget::measureTableSortLimit
int measureTableSortLimit() const
Returns the sorting limit for the measure table.
Definition: CnetEditorWidget.cpp:970
Isis::CnetEditorWidget::m_connectionModel
ImageImageTreeModel * m_connectionModel
Connection tree model.
Definition: CnetEditorWidget.h:203
Isis::CnetEditorWidget::pointTableSortLimit
int pointTableSortLimit() const
Returns the sorting limit for the point table.
Definition: CnetEditorWidget.cpp:990
Isis::CnetEditorWidget::configSorting
void configSorting()
Configures the sorting dialog.
Definition: CnetEditorWidget.cpp:1039
Isis::CnetEditorWidget::upgradeVersion
void upgradeVersion()
Upgrades the working version number.
Definition: CnetEditorWidget.cpp:626
Isis::CnetEditorWidget::serialTreeView
QWidget * serialTreeView()
Returns the serial tree view.
Definition: CnetEditorWidget.cpp:738
Isis::CnetEditorWidget::handlePointTableFilterCountsChanged
void handlePointTableFilterCountsChanged(int visibleRows, int totalRows)
Handles point table filter changes.
Definition: CnetEditorWidget.cpp:576
Isis::FilterWidget
This widget contains filtering capabilities for a single filter type.
Definition: FilterWidget.h:58
Isis::ControlPoint::Delete
int Delete(ControlMeasure *measure)
Remove a measurement from the control point, deleting reference measure is allowed.
Definition: ControlPoint.cpp:354
Isis::CnetEditorWidget::m_control
Control * m_control
Control for this widget.
Definition: CnetEditorWidget.h:180
Isis::CnetEditorWidget::m_settingsPath
QString * m_settingsPath
Path to read/write settings.
Definition: CnetEditorWidget.h:213
Isis::ControlNet::DeletePoint
int DeletePoint(ControlPoint *point)
Delete a ControlPoint from the network by the point's address.
Definition: ControlNet.cpp:879
Isis::CnetEditorWidget::m_measureTableModel
MeasureTableModel * m_measureTableModel
Measure table model.
Definition: CnetEditorWidget.h:206
Isis::PointTableModel
Table model for control points.
Definition: PointTableModel.h:39
Isis::CnetEditorWidget::m_pointTableView
TableView * m_pointTableView
Point table view.
Definition: CnetEditorWidget.h:189
QMap
This is free and unencumbered software released into the public domain.
Definition: CubeIoHandler.h:22
Isis::CnetEditorWidget::measureColToggled
void measureColToggled()
Toggles the measure column.
Definition: CnetEditorWidget.cpp:558
Isis::TreeView
Definition: TreeView.h:31
Isis::PointMeasureTreeModel
Tree model for control points and control measures.
Definition: PointMeasureTreeModel.h:49
Isis::CnetEditorWidget::pointTreeView
QWidget * pointTreeView()
Returns the point tree view.
Definition: CnetEditorWidget.cpp:728
QAction
Isis::CnetEditorWidget::pointColToggled
void pointColToggled()
Toggles the point column.
Definition: CnetEditorWidget.cpp:544
Isis::MeasureTableModel
Table model for control measures.
Definition: MeasureTableModel.h:42
Isis::CnetEditorWidget::createSerialTreeView
void createSerialTreeView()
Creates the serial tree and adds it to the model.
Definition: CnetEditorWidget.cpp:367
Isis::CnetEditorWidget::setPointTableSortLimit
void setPointTableSortLimit(int limit)
Sets the point table sorting limit.
Definition: CnetEditorWidget.cpp:1030
Isis::AbstractTreeItem
Base class for an item in the tree.
Definition: AbstractTreeItem.h:39
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::CnetEditorWidget::m_imageModel
ImagePointTreeModel * m_imageModel
Image tree model.
Definition: CnetEditorWidget.h:202
Isis::CnetEditorWidget::handleMeasureTableFilterCountsChanged
void handleMeasureTableFilterCountsChanged(int visibleRows, int totalRows)
Handles measure table filter changes.
Definition: CnetEditorWidget.cpp:592
Isis::ControlMeasure
a control measurement
Definition: ControlMeasure.h:175

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 15:16:16