Isis 3 Programmer Reference
CnetEditorWidget.cpp
1 #include "IsisDebug.h"
2 
3 #include "CnetEditorWidget.h"
4 
5 #include <QAction>
6 #include <QApplication>
7 #include <QBoxLayout>
8 #include <QByteArray>
9 #include <QCloseEvent>
10 #include <QDebug>
11 #include <QGroupBox>
12 #include <QHBoxLayout>
13 #include <QHeaderView>
14 #include <QItemSelection>
15 #include <QMenu>
16 #include <QMessageBox>
17 #include <QModelIndex>
18 #include <QScrollArea>
19 #include <QScrollBar>
20 #include <QSettings>
21 #include <QSplitter>
22 #include <QString>
23 #include <QStringList>
24 #include <QTime>
25 #include <QTimer>
26 #include <QToolBar>
27 #include <QVBoxLayout>
28 #include <QWhatsThis>
29 #include <QtXml>
30 
31 #include "AbstractMeasureItem.h"
32 #include "AbstractPointItem.h"
33 #include "AbstractTreeItem.h"
34 #include "CnetDisplayProperties.h"
35 #include "CnetEditorSortConfigDialog.h"
36 #include "Control.h"
37 #include "ControlMeasure.h"
38 #include "ControlNet.h"
39 #include "ControlPoint.h"
40 #include "FileName.h"
41 #include "FilterWidget.h"
42 #include "IException.h"
43 #include "ImageImageTreeModel.h"
44 #include "ImagePointTreeModel.h"
45 #include "MeasureTableModel.h"
46 #include "PointMeasureTreeModel.h"
47 #include "PointTableModel.h"
48 #include "Project.h"
49 #include "TableView.h"
50 #include "TableViewHeader.h"
51 #include "TreeView.h"
52 #include "XmlStackedHandler.h"
53 #include "XmlStackedHandlerReader.h"
54 
55 
56 namespace Isis {
57 
58 //**************************************************************
59 //**************************************************************
60 //**************************************************************
61 
62  const QString CnetEditorWidget::VERSION = "0.1";
63 
64 //**************************************************************
65 //**************************************************************
66 //**************************************************************
67 
68 
69  CnetEditorWidget::CnetEditorWidget(Control *control, QString pathForSettings) {
70  nullify();
71 
72  m_workingVersion = new QString;
75 
76  m_updatingSelection = false;
77 
78  m_sortDialog = NULL;
79 
81  connect(CnetDisplayProperties::getInstance(), SIGNAL(compositionFinished()),
82  this, SLOT(rebuildModels()));
83 
84  connect(this, SIGNAL(cnetModified()), this, SLOT(setCnetModified()));
85  m_settingsPath = new QString(pathForSettings);
86 
87  QBoxLayout *mainLayout = createMainLayout();
88  setLayout(mainLayout);
89 
90  createActions();
91 
92  readSettings();
93 
95 
96  installEventFilter(this);
97  }
98 
99 
104 
105  writeSettings();
106 
107  delete m_workingVersion;
108  m_workingVersion = NULL;
109 
110  delete m_settingsPath;
111  m_settingsPath = NULL;
112 
113  delete m_pointTreeView;
114  m_pointTreeView = NULL;
115 
116  delete m_imageTreeView;
117  m_imageTreeView = NULL;
118 
119  delete m_connectionTreeView;
120  m_connectionTreeView = NULL;
121 
122  delete m_pointTableView;
123  m_pointTableView = NULL;
124 
125  delete m_measureTableView;
126  m_measureTableView = NULL;
127 
128  delete m_pointFilterWidget;
129  m_pointFilterWidget = NULL;
130 
131  delete m_serialFilterWidget;
132  m_serialFilterWidget = NULL;
133 
136 
137  delete m_menuActions;
138  m_menuActions = NULL;
139 
140  delete m_toolBarActions;
141  m_toolBarActions = NULL;
142 
143  m_pointTableBox = NULL;
144  m_measureTableBox = NULL;
145  m_mainSplitter = NULL;
146 
147  // TODO: null all member widgets!
148 
149  delete m_pointModel;
150  m_pointModel = NULL;
151 
152  delete m_imageModel;
153  m_imageModel = NULL;
154 
155  delete m_connectionModel;
156  m_connectionModel = NULL;
157 
158  delete m_sortDialog;
159  m_sortDialog = NULL;
160  }
161 
162 
167  m_pointTreeView = NULL;
168  m_imageTreeView = NULL;
169  m_connectionTreeView = NULL;
170 
171  m_pointModel = NULL;
172  m_imageModel = NULL;
173  m_connectionModel = NULL;
174 
175  m_pointTableModel = NULL;
176  m_measureTableModel = NULL;
177 
178  m_pointTableBox = NULL;
179  m_measureTableBox = NULL;
180 
181  m_pointTableView = NULL;
182  m_measureTableView = NULL;
183 
184  m_mainSplitter = NULL;
185 
186  m_menuActions = NULL;
187  m_toolBarActions = NULL;
188 
189  m_filterArea = NULL;
190 
191  m_pointFilterWidget = NULL;
192  m_serialFilterWidget = NULL;
194 
195  m_control = NULL;
196  m_settingsPath = NULL;
197  m_workingVersion = NULL;
198 
199  m_sortDialog = NULL;
200  }
201 
202 
209  m_pointModel->stopWorking();
210  m_imageModel->stopWorking();
211  m_connectionModel->stopWorking();
212 
213  bool ignoreAll = false;
214  foreach (AbstractTreeItem * item, itemsToDelete) {
215  try {
216  item->deleteSource();
217  }
218  catch (IException &e) {
219  QString message = e.what();
220 
221  if (!ignoreAll) {
222  if (item == itemsToDelete.last()) {
223  QMessageBox::warning(
224  this, "Failed to delete row", message, QMessageBox::Ok);
225  }
226  else {
227  message += "\n\nOkay to continue?";
228 
229  QMessageBox::StandardButton status = QMessageBox::warning(
230  this, "Failed to delete row", message, QMessageBox::Yes |
231  QMessageBox::YesToAll | QMessageBox::No);
232 
233  if (status == QMessageBox::YesToAll)
234  ignoreAll = true;
235  else if (status == QMessageBox::No)
236  break;
237  }
238  }
239  }
240  }
241 
242  m_pointModel->rebuildItems();
243  m_imageModel->rebuildItems();
244  m_connectionModel->rebuildItems();
245  }
246 
247 
255 
256  connect(m_pointTreeView, SIGNAL(activated()),
257  m_imageTreeView, SLOT(deactivate()));
258  connect(m_pointTreeView, SIGNAL(activated()),
259  m_connectionTreeView, SLOT(deactivate()));
260 
261  connect(m_imageTreeView, SIGNAL(activated()),
262  m_pointTreeView, SLOT(deactivate()));
263  connect(m_imageTreeView, SIGNAL(activated()),
264  m_connectionTreeView, SLOT(deactivate()));
265 
266  connect(m_connectionTreeView, SIGNAL(activated()),
267  m_pointTreeView, SLOT(deactivate()));
268  connect(m_connectionTreeView, SIGNAL(activated()),
269  m_imageTreeView, SLOT(deactivate()));
270 
272 
274  m_pointTableBox = new QGroupBox(tr("Control Point Table"));
275  QHBoxLayout *pointTableLayout = new QHBoxLayout;
276  pointTableLayout->addWidget(m_pointTableView);
277  m_pointTableBox->setLayout(pointTableLayout);
278 
280  m_measureTableBox = new QGroupBox(tr("Control Measure Table"));
281  QHBoxLayout *measureTableLayout = new QHBoxLayout;
282  measureTableLayout->addWidget(m_measureTableView);
283  m_measureTableBox->setLayout(measureTableLayout);
284 
285  m_mainSplitter = new QSplitter(Qt::Vertical);
286  m_mainSplitter->addWidget(m_pointTableBox);
287  m_mainSplitter->addWidget(m_measureTableBox);
288 
289  QBoxLayout *mainLayout = new QHBoxLayout;
290  mainLayout->addWidget(m_mainSplitter);
291 
292  return mainLayout;
293  }
294 
295 
300  ASSERT(m_menuActions);
301 
302  QAction *freezeTablesAct = new QAction(QIcon(FileName("$base/icons/ice.png").expanded()),
303  tr("&Freeze Tables"), this);
304  freezeTablesAct->setCheckable(true);
305  freezeTablesAct->setToolTip(tr("Freeze tables (filters will not take "
306  "effect until unfrozen)"));
307  freezeTablesAct->setStatusTip(tr("Freeze tables (filters will not take "
308  "effect until unfrozen)"));
309  freezeTablesAct->setWhatsThis(tr("<html>When frozen, the contents of the "
310  "tables will be locked. Current filters will not be applied to the "
311  "tables until they are unfrozen.</html>"));
312  connect(freezeTablesAct, SIGNAL(toggled(bool)),
313  this, SLOT(setTablesFrozen(bool)));
314  QList< QString > freezeTablesLocation;
315  freezeTablesLocation.append(tr("&Tables"));
316  m_menuActions->insert(freezeTablesAct, freezeTablesLocation);
317 
318  QAction *configureSortAct = new QAction(QIcon(FileName("$base/icons/sort.png").expanded()),
319  tr("&Sorting Options..."), this);
320  QString configureSortToolTipText = tr("Configure table sorting options");
321  configureSortAct->setToolTip(configureSortToolTipText);
322  configureSortAct->setStatusTip(configureSortToolTipText);
323  configureSortAct->setWhatsThis(tr("<html>Click here to configure options "
324  "related to the sorting of table columns.</html>"));
325  connect(configureSortAct, SIGNAL(triggered()),
326  this, SLOT(configSorting()));
327  QList< QString > configureSortLocation;
328  configureSortLocation.append(tr("&Tables"));
329  m_menuActions->insert(configureSortAct, configureSortLocation);
330 
331  QAction *whatsThisAct = QWhatsThis::createAction(this);
332  QList< QString > whatsThisLocation;
333  whatsThisLocation.append(tr("&Help"));
334  m_menuActions->insert(whatsThisAct, whatsThisLocation);
335 
336  QList< QAction * > tbActionList;
337  tbActionList.append(freezeTablesAct);
338  tbActionList.append(configureSortAct);
339  m_toolBarActions->insert("settingsToolBar", tbActionList);
340  }
341 
342 
347  m_pointTreeView = new TreeView();
348  m_pointTreeView->setTitle("Point View");
350  m_pointTreeView->setModel(m_pointModel);
351  }
352 
353 
358  m_imageTreeView = new TreeView();
359  m_imageTreeView->setTitle("Cube View");
361  m_imageTreeView->setModel(m_imageModel);
362  }
363 
364 
370  m_connectionTreeView->setTitle("Cube Connection View");
373  }
374 
375 
380  ASSERT(m_pointModel);
381  ASSERT(m_imageModel);
382  ASSERT(m_connectionModel);
383 
384  FilterWidget *pointFilter = new FilterWidget("Points and Measures");
385  if (m_pointModel) {
386  m_pointModel->setFilter(pointFilter);
387  }
388 
389  QHBoxLayout *pointFilterLayout = new QHBoxLayout;
390  pointFilterLayout->addWidget(pointFilter);
391  QWidget *pointArea = new QWidget;
392  pointArea->setLayout(pointFilterLayout);
393  QScrollArea *pointFilterScrollArea = new QScrollArea;
394  pointFilterScrollArea->setWidget(pointArea);
395  pointFilterScrollArea->setWidgetResizable(true);
396  m_pointFilterWidget = pointFilterScrollArea;
397 
398  FilterWidget *serialFilter = new FilterWidget("Images and Points");
399  if (m_imageModel) {
400  m_imageModel->setFilter(serialFilter);
401  }
402 
403  QHBoxLayout *serialFilterLayout = new QHBoxLayout;
404  serialFilterLayout->addWidget(serialFilter);
405  QWidget *serialArea = new QWidget;
406  serialArea->setLayout(serialFilterLayout);
407  QScrollArea *serialFilterScrollArea = new QScrollArea;
408  serialFilterScrollArea->setWidget(serialArea);
409  serialFilterScrollArea->setWidgetResizable(true);
410  m_serialFilterWidget = serialFilterScrollArea;
411 
412  FilterWidget *connectionFilter = new FilterWidget("Connections");
413  if (m_connectionModel) {
414  m_connectionModel->setFilter(connectionFilter);
415  }
416 
417  QHBoxLayout *connectionFilterLayout = new QHBoxLayout;
418  connectionFilterLayout->addWidget(connectionFilter);
419  QWidget *connectionArea = new QWidget;
420  connectionArea->setLayout(connectionFilterLayout);
421  QScrollArea *connectionFilterScrollArea = new QScrollArea;
422  connectionFilterScrollArea->setWidget(connectionArea);
423  connectionFilterScrollArea->setWidgetResizable(true);
424  m_connectionFilterWidget = connectionFilterScrollArea;
425  }
426 
427 
434  "m_pointTableView");
435  m_pointTableView->setWhatsThis("<html>Each row in the table is a control "
436  "point. Each column in the table is an attribute of a control "
437  "point.<br/><br/>Cells that are gray are not editable.</html>");
438  connect(m_pointTableView, SIGNAL(modelDataChanged()),
439  this, SIGNAL(cnetModified()));
440 
441  connect(m_pointTreeView, SIGNAL(selectionChanged()),
442  m_pointTableView, SLOT(handleModelSelectionChanged()));
443  connect(m_pointTableView, SIGNAL(selectionChanged()),
444  m_pointTreeView, SLOT(handleModelSelectionChanged()));
445 
446  connect(m_pointTableView,
448  this,
450 
451  connect(m_pointTableView, SIGNAL(filterCountsChanged(int, int)),
452  this, SLOT(handlePointTableFilterCountsChanged(int, int)));
453 
454  connect(m_pointTableView, SIGNAL(editControlPoint(ControlPoint *, QString)),
455  this, SIGNAL(editControlPoint(ControlPoint *, QString)));
456 
457  for (int i = 0; i < AbstractPointItem::COLS; i++) {
458  QAction *act = new QAction(
459  AbstractPointItem::getColumnName((AbstractPointItem::Column) i), this);
460  act->setCheckable(true);
461  connect(act, SIGNAL(toggled(bool)), this, SLOT(pointColToggled()));
462  m_pointTableView->getHorizontalHeader()->addAction(act);
463  }
464 
465  m_pointTableView->getHorizontalHeader()->setContextMenuPolicy(
466  Qt::ActionsContextMenu);
467  }
468 
469 
476  "m_measureTableView");
477  m_measureTableView->setWhatsThis("<html>Each row in the table is a control "
478  "measure. Each column in the table is an attribute of a control "
479  "measure.<br/><br/>Rows with bold text are reference measures. "
480  "Cells that are gray are not editable.</html>");
481  ASSERT(m_pointTableView);
482  connect(m_pointTableView,
483  SIGNAL(tableSelectionChanged(QList< AbstractTreeItem * >)),
485  SLOT(handleTreeSelectionChanged(QList<AbstractTreeItem *>)));
486 
487  connect(m_measureTableView,
488  SIGNAL(tableSelectionChanged(QList< AbstractTreeItem * >)),
490  SLOT(handleTreeSelectionChanged(QList< AbstractTreeItem * >)));
491 
492 
493  connect(m_measureTableView, SIGNAL(modelDataChanged()),
494  this, SIGNAL(cnetModified()));
495  connect(m_pointTreeView, SIGNAL(selectionChanged()),
496  m_measureTableView, SLOT(handleModelSelectionChanged()));
497  connect(m_measureTableView, SIGNAL(selectionChanged()),
498  m_pointTreeView, SLOT(handleModelSelectionChanged()));
499  connect(m_measureTableView,
501  this,
503 
504  connect(m_measureTableView, SIGNAL(filterCountsChanged(int, int)),
505  this, SLOT(handleMeasureTableFilterCountsChanged(int, int)));
506 
507  connect(m_measureTableView, SIGNAL(editControlPoint(ControlPoint *, QString)),
508  this, SIGNAL(editControlPoint(ControlPoint *, QString)));
509 
510  for (int i = 0; i < AbstractMeasureItem::COLS; i++) {
511  QAction *act = new QAction(AbstractMeasureItem::getColumnName(
512  (AbstractMeasureItem::Column) i), this);
513  act->setCheckable(true);
514  connect(act, SIGNAL(toggled(bool)), this, SLOT(measureColToggled()));
515  m_measureTableView->getHorizontalHeader()->addAction(act);
516  }
517 
518  m_measureTableView->getHorizontalHeader()->setContextMenuPolicy(
519  Qt::ActionsContextMenu);
520  }
521 
522 
528  }
529 
530 
535  QList< QAction * > actions =
537 
538  for (int i = 0; i < actions.size(); i++) {
539  m_pointTableView->setColumnVisible(actions[i]->text(),
540  actions[i]->isChecked());
541  }
542  }
543 
544 
549  QList< QAction * > actions =
551  for (int i = 0; i < actions.size(); i++)
552  m_measureTableView->setColumnVisible(actions[i]->text(),
553  actions[i]->isChecked());
554  }
555 
556 
567  int visibleRows, int totalRows) {
568  handleTableFilterCountsChanged(visibleRows, totalRows, m_pointTableBox,
569  "Control Point Table");
570  }
571 
572 
583  int visibleRows, int totalRows) {
584  handleTableFilterCountsChanged(visibleRows, totalRows, m_measureTableBox,
585  "Control Measure Table");
586  }
587 
588 
598  int visibleRows, int totalRows, QGroupBox *box, QString initialText) {
599  if (box) {
600  QString newTitle = initialText + " (";
601  if (visibleRows > -1)
602  newTitle += QString::number(visibleRows);
603  else
604  newTitle += "???";
605 
606  newTitle += " / " + QString::number(totalRows) + ")";
607 
608  box->setTitle(newTitle);
609  }
610  }
611 
612 
617  if (*m_workingVersion == "") {
618  *m_workingVersion = "0.1";
619  }
620 
621  if (*m_workingVersion != VERSION)
622  upgradeVersion();
623  }
624 
625 
630  ASSERT(m_workingVersion);
631  ASSERT(m_settingsPath);
632  ASSERT(m_measureTableView);
633 
634  QSettings settings(*m_settingsPath, QSettings::NativeFormat);
635  *m_workingVersion = settings.value("version", "").toString();
636 
637  m_mainSplitter->restoreState(settings.value("mainSplitter").toByteArray());
638 
639  QString key;
640 
641  QList< QAction * > actions =
643  for (int i = 0; i < actions.size(); i++) {
644  key = m_measureTableView->objectName() + " " +
645  AbstractMeasureItem::getColumnName((AbstractMeasureItem::Column) i);
646  key.replace(" ", "_");
647  actions[i]->setChecked(settings.value(key, true).toBool());
648  }
649 
650  actions = m_pointTableView->getHorizontalHeader()->actions();
651  for (int i = 0; i < actions.size(); i++) {
652  key = m_pointTableView->objectName() + " " +
653  AbstractPointItem::getColumnName((AbstractPointItem::Column) i);
654  key.replace(" ", "_");
655  actions[i]->setChecked(settings.value(key, true).toBool());
656  }
657 
658  // Restore sorting configuration settings.
660  settings.value("measureTableSortingEnabled", true).toBool());
662  settings.value("measureTableSortLimit", 500000).toInt());
664  settings.value("pointTableSortingEnabled", true).toBool());
666  settings.value("pointTableSortLimit", 100000).toInt());
667  }
668 
669 
674  ASSERT(m_mainSplitter);
675  ASSERT(m_settingsPath);
676  ASSERT(m_measureTableView);
677 
678  QSettings settings(*m_settingsPath, QSettings::NativeFormat);
679  settings.setValue("version", VERSION);
680  settings.setValue("mainSplitter", m_mainSplitter->saveState());
681 
682  QString key;
683 
684  QList< QAction * > actions =
686  for (int i = 0; i < actions.size(); i++) {
687  key = m_measureTableView->objectName() + " " +
688  AbstractMeasureItem::getColumnName((AbstractMeasureItem::Column) i);
689  key.replace(" ", "_");
690  settings.setValue(key, actions[i]->isChecked());
691  }
692 
693  actions = m_pointTableView->getHorizontalHeader()->actions();
694  for (int i = 0; i < actions.size(); i++) {
695  key = m_pointTableView->objectName() + " " +
696  AbstractPointItem::getColumnName((AbstractPointItem::Column) i);
697  key.replace(" ", "_");
698  settings.setValue(key, actions[i]->isChecked());
699  }
700 
701  // Write sorting configuration settings.
702  settings.setValue("measureTableSortingEnabled",
704  settings.setValue("measureTableSortLimit",
706  settings.setValue("pointTableSortingEnabled",
708  settings.setValue("pointTableSortLimit",
710  }
711 
712 
719  return m_pointTreeView;
720  }
721 
722 
729  return m_imageTreeView;
730  }
731 
732 
739  return m_connectionTreeView;
740  }
741 
742 
749  return m_pointFilterWidget;
750  }
751 
752 
759  return m_serialFilterWidget;
760  }
761 
762 
770  }
771 
772 
779  return m_pointTableView;
780  }
781 
782 
789  return m_measureTableView;
790  }
791 
792 
799  return m_measureTableModel;
800  }
801 
802 
809  return m_pointTableModel;
810  }
811 
812 
819  return m_control->controlNet();
820  }
821 
822 
829  ASSERT(m_menuActions);
830  return *m_menuActions;
831  }
832 
833 
840  ASSERT(m_toolBarActions);
841  return *m_toolBarActions;
842  }
843 
844 
851  ControlNet *filteredCnet = new ControlNet(*(m_control->controlNet()));
852 
853  QList<AbstractTreeItem *> networkItems = m_pointModel->getItems(0, -1,
854  AbstractTreeModel::MeasureItems | AbstractTreeModel::PointItems, true);
855 
856  // Iterate through our copy of the cnet, deleting anything that doesn't
857  // exactly match our networkItems.
858  for (int pointIndex = filteredCnet->GetNumPoints() - 1;
859  pointIndex >= 0;
860  pointIndex--) {
861  if (networkItems.isEmpty()) {
862  ControlPoint *cp = filteredCnet->GetPoint(pointIndex);
863  cp->SetEditLock(false);
864 
865  for (int measureIndex = 0;
866  measureIndex < cp->GetNumMeasures();
867  measureIndex++) {
868  cp->GetMeasure(measureIndex)->SetEditLock(false);
869  }
870 
871  filteredCnet->DeletePoint(cp);
872  }
873  else if (networkItems.last()->getPointerType() ==
874  AbstractTreeItem::Point) {
875  ControlPoint *networkItemsCp =
876  (ControlPoint *)networkItems.last()->getPointer();
877  ControlPoint *cp = filteredCnet->GetPoint(pointIndex);
878  if (cp->GetId() != networkItemsCp->GetId()) {
879  cp->SetEditLock(false);
880 
881  for (int measureIndex = 0;
882  measureIndex < cp->GetNumMeasures();
883  measureIndex++) {
884  cp->GetMeasure(measureIndex)->SetEditLock(false);
885  }
886 
887  filteredCnet->DeletePoint(cp);
888  }
889  else {
890  networkItems.removeLast();
891  }
892  }
893  else if (networkItems.last()->getPointerType() ==
894  AbstractTreeItem::Measure) {
895  ControlPoint *cp = filteredCnet->GetPoint(pointIndex);
896  ControlMeasure *networkItemsCm =
897  (ControlMeasure *)networkItems.last()->getPointer();
898 
899  if (cp->GetId() != networkItemsCm->Parent()->GetId()) {
900  cp->SetEditLock(false);
901 
902  for (int measureIndex = 0;
903  measureIndex < cp->GetNumMeasures();
904  measureIndex++) {
905  cp->GetMeasure(measureIndex)->SetEditLock(false);
906  }
907 
908  filteredCnet->DeletePoint(cp);
909  }
910  else {
911  // Our CP stays, figure out which CMs stay.
912  for (int measureIndex = cp->GetNumMeasures() - 1;
913  networkItemsCm && measureIndex >= 0;
914  measureIndex--) {
915  ControlMeasure *cm = cp->GetMeasure(measureIndex);
916  if (cm->GetCubeSerialNumber() !=
917  networkItemsCm->GetCubeSerialNumber()) {
918  cm->SetEditLock(false);
919  cp->Delete(cm);
920  }
921  else {
922  networkItems.removeLast();
923  networkItemsCm = NULL;
924 
925  if (networkItems.last()->getPointerType() ==
926  AbstractTreeItem::Measure) {
927  networkItemsCm =
928  (ControlMeasure *)networkItems.last()->getPointer();
929  }
930  }
931  }
932 
933  // We still need to verify the copied CP at this index... although
934  // nothing should go wrong, we know things do go wrong so do
935  // the verify instead of just tossing the last networkItems item.
936  pointIndex++;
937  }
938  }
939  }
940 
941  return filteredCnet;
942  }
943 
944 
951  return m_measureTableModel->sortingIsEnabled();
952  }
953 
954 
961  return m_measureTableModel->sortLimit();
962  }
963 
964 
971  return m_pointTableModel->sortingIsEnabled();
972  }
973 
974 
981  return m_pointTableModel->sortLimit();
982  }
983 
984 
991  m_measureTableModel->setSortingEnabled(enabled);
992  }
993 
994 
1001  m_measureTableModel->setSortLimit(limit);
1002  }
1003 
1004 
1011  m_pointTableModel->setSortingEnabled(enabled);
1012  }
1013 
1014 
1021  m_pointTableModel->setSortLimit(limit);
1022  }
1023 
1024 
1030  if (!m_sortDialog) {
1032  }
1033  m_sortDialog->show();
1034  }
1035 
1036 
1042  void CnetEditorWidget::setTablesFrozen(bool freezeTables) {
1043  if (freezeTables) {
1044  m_connectionModel->setFrozen(true);
1045  m_imageModel->setFrozen(true);
1046  m_pointModel->setFrozen(true);
1047  }
1048  else {
1049  m_pointModel->setFrozen(false);
1050  m_imageModel->setFrozen(false);
1051  m_connectionModel->setFrozen(false);
1052  }
1053  }
1054 
1055 
1060  m_control->setModified(true);
1061  }
1062 }
void setTablesFrozen(bool)
Sets if the tables are frozen.
int pointTableSortLimit() const
Returns the sorting limit for the point table.
void configSorting()
Configures the sorting dialog.
QWidget * m_pointFilterWidget
Point filter widget.
const char * what() const
Returns a string representation of this exception in its current state.
Definition: IException.cpp:391
bool pointTableSortingEnabled() const
Returns true if the point table can be sorted.
int measureTableSortLimit() const
Returns the sorting limit for the measure table.
TreeView * m_connectionTreeView
Connection tree view.
void setMeasureTableSortLimit(int limit)
Sets the measure table sorting limit.
void measureColToggled()
Toggles the measure column.
File name manipulation and expansion.
Definition: FileName.h:116
void nullify()
Sets all member variables to NULL.
void handlePointTableFilterCountsChanged(int visibleRows, int totalRows)
Handles point table filter changes.
void createConnectionTreeView()
Creates the connection tree and adds it to the model.
const ControlMeasure * GetMeasure(QString serialNumber) const
Get a control measure based on its cube&#39;s serial number.
Control * m_control
Control for this widget.
Configure user&#39;s sorting settings for the cneteditor widget.
void createSerialTreeView()
Creates the serial tree and adds it to the model.
QMap< QString, QList< QAction *> > toolBarActions()
Returns the tool bar actions.
TableView * m_pointTableView
Point table view.
void setPointTableSortLimit(int limit)
Sets the point table sorting limit.
TableView * m_measureTableView
Measure table view.
Tree model for control points and control measures.
Tree model for images and control points.
QWidget * pointTreeView()
Returns the point tree view.
TreeView * m_imageTreeView
Image tree view.
QString * m_workingVersion
Working version.
virtual ~CnetEditorWidget()
Destructor.
TreeView * m_pointTreeView
Point tree view.
static const QString VERSION
Version.
bool m_updatingSelection
Updates selection.
ImagePointTreeModel * m_imageModel
Image tree model.
Status SetEditLock(bool editLock)
Set the EditLock state.
void handleMeasureTableFilterCountsChanged(int visibleRows, int totalRows)
Handles measure table filter changes.
void writeSettings()
Writes the configuration settings used.
PointTableModel * m_pointTableModel
Point table model.
QWidget * connectionFilterWidget()
Returns the connection filter widget.
AbstractTableModel * measureTableModel()
Returns the measure table model.
ImageImageTreeModel * m_connectionModel
Connection tree model.
void rebuildModels()
Rebuilds the models.
TableViewHeader * getHorizontalHeader()
Returns the horizontal header.
Definition: TableView.cpp:156
int GetNumPoints() const
Return the number of control points in the network.
QGroupBox * m_measureTableBox
Measure table box.
QString * m_settingsPath
Path to read/write settings.
TableView * pointTableView()
Returns the point table view.
MeasureTableModel * m_measureTableModel
Measure table model.
a control network
Definition: ControlNet.h:271
void setPointTableSortingEnabled(bool enabled)
Sets if the point table can be sorted.
QString GetId() const
Return the Id of the control point.
void upgradeVersion()
Upgrades the working version number.
Translates the tree model into a table model.
QWidget * serialTreeView()
Returns the serial tree view.
CnetEditorSortConfigDialog * m_sortDialog
Sorting dialog.
Tree model for images and images.
void pointColToggled()
Toggles the point column.
QMap< QString, QList< QAction *> > * m_toolBarActions
QMap of tool bar actions.
void createFilterArea()
Creates filter widgets.
int DeletePoint(ControlPoint *point)
Delete a ControlPoint from the network by the point&#39;s address.
Definition: ControlNet.cpp:871
A single control point.
Definition: ControlPoint.h:369
ControlNet * controlNet()
Open and return a pointer to the ControlNet for this Control.
Definition: Control.cpp:142
void setColumnVisible(QString, bool)
Sets the specified column visible or invisible.
Definition: TableView.cpp:167
ControlNet * filteredNetwork() const
Returns the filtered control net.
void setMeasureTableSortingEnabled(bool enabled)
Sets if the measure table can be sorted.
QWidget * pointFilterWidget()
Returns the point filter widget.
QWidget * m_serialFilterWidget
Serial filter widget.
void createMeasureTableView()
Creates the measure table and adds it to the widget.
QMap< QAction *, QList< QString > > menuActions()
Returns the menu actions.
void createPointTreeView()
Creates the point tree view and adds it to the model.
void createPointTableView()
Creates the point table and adds it to the widget.
QWidget * m_connectionFilterWidget
Connection filter widget.
QGroupBox * m_pointTableBox
Point table box.
void createActions()
Creates the menus, and options for the widget.
QWidget * connectionTreeView()
Returns the connection tree view.
void setCnetModified()
Connected to cnetModified().
void handleTableFilterCountsChanged(int visibleRows, int totalRows, QGroupBox *box, QString initialText)
Handles any table filter changes.
void setModified(bool modified=true)
Sets the modification state of this control.
Definition: Control.cpp:233
Isis exception class.
Definition: IException.h:107
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
QSplitter * m_mainSplitter
Splitter.
a control measurement
QWidget * serialFilterWidget()
Returns the serial filter widget.
This widget contains filtering capabilities for a single filter type.
Definition: FilterWidget.h:51
int Delete(ControlMeasure *measure)
Remove a measurement from the control point, deleting reference measure is allowed.
bool measureTableSortingEnabled() const
Returns true if the measure table can be sorted.
AbstractTableModel * pointTableModel()
Returns the point table model.
Table model for control measures.
QScrollArea * m_filterArea
Scroll area for filters.
Base class for an item in the tree.
ControlNet * control()
Returns the control network.
QMap< QAction *, QList< QString > > * m_menuActions
QMap of menu actions.
QBoxLayout * createMainLayout()
Creates the layout of the widget.
PointMeasureTreeModel * m_pointModel
Point tree model.
QString GetCubeSerialNumber() const
Return the serial number of the cube containing the coordinate.
TableView * measureTableView()
Returns the measure table view.
Table model for control points.
void readSettings()
Reads the working version settings stored at the settings path.