Isis 3 Programmer Reference
Directory.cpp
1
7/* SPDX-License-Identifier: CC0-1.0 */
8
9#include "Directory.h"
10
11
12#include <QAction>
13#include <QApplication>
14#include <QDockWidget>
15#include <QGridLayout>
16#include <QMainWindow>
17#include <QMenu>
18#include <QMenuBar>
19#include <QMessageBox>
20#include <QRegExp>
21#include <QSettings>
22#include <QSizePolicy>
23#include <QSplitter>
24#include <QStringList>
25#include <QtDebug>
26#include <QVariant>
27#include <QXmlStreamWriter>
28
29
30#include "BundleObservation.h"
31#include "BundleObservationView.h"
32#include "BundleObservationViewWorkOrder.h"
33#include "ChipViewportsWidget.h"
34#include "CloseProjectWorkOrder.h"
35#include "CnetEditorView.h"
36#include "CnetEditorViewWorkOrder.h"
37#include "ControlHealthMonitorView.h"
38#include "ControlHealthMonitorWorkOrder.h"
39#include "CnetEditorWidget.h"
40#include "Control.h"
41#include "ControlDisplayProperties.h"
42#include "ControlList.h"
43#include "ControlNet.h"
44#include "ControlNetTool.h"
45#include "ControlPointEditView.h"
46#include "ControlPointEditWidget.h"
47#include "CubeDnView.h"
48#include "CubeDnViewWorkOrder.h"
49#include "ExportControlNetWorkOrder.h"
50#include "ExportImagesWorkOrder.h"
51#include "FileItem.h"
52#include "FileName.h"
53#include "Footprint2DView.h"
55#include "HistoryTreeWidget.h"
56#include "IException.h"
57#include "IString.h"
59#include "ImageFileListWidget.h"
65#include "JigsawRunWidget.h"
66#include "JigsawWorkOrder.h"
67#include "MatrixSceneWidget.h"
68#include "MatrixViewWorkOrder.h"
69#include "MosaicControlNetTool.h"
70#include "MosaicSceneWidget.h"
72#include "Project.h"
73#include "ProjectItem.h"
74#include "ProjectItemModel.h"
75#include "ProjectItemTreeView.h"
81#include "SensorInfoWidget.h"
84#include "TableView.h"
85#include "TableViewContent.h"
86#include "TargetInfoWidget.h"
88#include "TemplateEditorWidget.h"
90#include "ToolPad.h"
91#include "WarningTreeWidget.h"
92#include "WorkOrder.h"
93#include "Workspace.h"
94
95namespace Isis {
96
104
105 try {
106 m_project = new Project(*this);
107 }
108 catch (IException &e) {
110 "Could not create directory because Project could not be created.",
111 _FILEINFO_);
112 }
113
114 //connect( m_project, SIGNAL(imagesAdded(ImageList *) ),
115 //this, SLOT(imagesAddedToProject(ImageList *) ) );
116
117 //connect( m_project, SIGNAL(targetsAdded(TargetBodyList *) ),
118 //this, SLOT(targetsAddedToProject(TargetBodyList *) ) );
119
120 //connect( m_project, SIGNAL(guiCamerasAdded(GuiCameraList *) ),
121 //this, SLOT(guiCamerasAddedToProject(GuiCameraList *) ) );
122
123 connect( m_project, SIGNAL(projectLoaded(Project *) ),
124 this, SLOT(updateRecentProjects(Project *) ) );
125
126 // Send cnetModified() to project, so that we can set the project's clean state.
127 // In the slot cnetModified(), it checks if the active was modified and then emits
128 // activeControlModified(). This signal is connected below to this activeControlModified(),
129 // which connects to views that use the active cnet to redraw themselves.
130 // Ultimately, cnetModified() allows us to save changes made to any cnet, and
131 // activeControlModified() allows other views to be redrawn.
132 connect(this, SIGNAL(cnetModified()), m_project, SLOT(cnetModified()));
133 connect(project(), SIGNAL(activeControlModified()), this, SIGNAL(activeControlModified()));
134
135 connect(m_project, SIGNAL(activeControlSet(bool)), this, SLOT(newActiveControl(bool)));
136 connect(m_project, SIGNAL(discardActiveControlEdits()),
138
140 m_projectItemModel->addProject(m_project);
141 connect(m_projectItemModel, SIGNAL(cleanProject(bool)), this, SIGNAL(cleanProject(bool)));
142
143 try {
144
145 // Context menu actions
146 createWorkOrder<SetActiveImageListWorkOrder>();
147 createWorkOrder<SetActiveControlWorkOrder>();
148 createWorkOrder<CnetEditorViewWorkOrder>();
149 createWorkOrder<CubeDnViewWorkOrder>();
150 createWorkOrder<Footprint2DViewWorkOrder>();
151 createWorkOrder<MatrixViewWorkOrder>();
152 createWorkOrder<SensorGetInfoWorkOrder>();
153 //createWorkOrder<RemoveImagesWorkOrder>();
154 createWorkOrder<TargetGetInfoWorkOrder>();
155 createWorkOrder<BundleObservationViewWorkOrder>();
156 createWorkOrder<TemplateEditViewWorkOrder>();
157 createWorkOrder<ControlHealthMonitorWorkOrder>();
158
159 // Main menu actions
160 m_exportControlNetWorkOrder = createWorkOrder<ExportControlNetWorkOrder>();
161 m_exportImagesWorkOrder = createWorkOrder<ExportImagesWorkOrder>();
162 m_importControlNetWorkOrder = createWorkOrder<ImportControlNetWorkOrder>();
163 m_importImagesWorkOrder = createWorkOrder<ImportImagesWorkOrder>();
164 m_importShapesWorkOrder = createWorkOrder<ImportShapesWorkOrder>();
165 m_importMapTemplateWorkOrder = createWorkOrder<ImportMapTemplateWorkOrder>();
166 m_importRegistrationTemplateWorkOrder = createWorkOrder<ImportRegistrationTemplateWorkOrder>();
167 m_openProjectWorkOrder = createWorkOrder<OpenProjectWorkOrder>();
168 m_saveProjectWorkOrder = createWorkOrder<SaveProjectWorkOrder>();
169 m_saveProjectAsWorkOrder = createWorkOrder<SaveProjectAsWorkOrder>();
170 m_runJigsawWorkOrder = createWorkOrder<JigsawWorkOrder>();
171 m_closeProjectWorkOrder = createWorkOrder<CloseProjectWorkOrder>();
172 m_renameProjectWorkOrder = createWorkOrder<RenameProjectWorkOrder>();
173 m_recentProjectsLoaded = false;
174 }
175 catch (IException &e) {
177 "Could not create directory because work orders are corrupt.",
178 _FILEINFO_);
179 }
180
182 m_editPointId = "";
183 }
184
185
190
191 m_workOrders.clear();
192
193 if (m_project) {
194 m_project ->deleteLater();
195 m_project = NULL;
196 }
197 }
198
199
204 QList<QAction *> Directory::fileMenuActions() {
205 return m_fileMenuActions;
206 }
207
208
213 QList<QAction *> Directory::projectMenuActions() {
215 }
216
217
222 QList<QAction *> Directory::editMenuActions() {
223 return m_editMenuActions;
224 }
225
226
231 QList<QAction *> Directory::viewMenuActions() {
232 return m_viewMenuActions;
233 }
234
235
242 }
243
244
249 QList<QAction *> Directory::helpMenuActions() {
250 return m_helpMenuActions;
251 }
252
253
258 QList<QAction *> Directory::permToolBarActions() {
260 }
261
262
269 }
270
271
276 QList<QAction *> Directory::toolPadActions() {
277 return m_toolPadActions;
278 }
279
280
288 emit directoryCleaned();
289
290 m_historyTreeWidget->clear();
291 m_warningTreeWidget->clear();
292 m_bundleObservationViews.clear();
294 m_cubeDnViewWidgets.clear();
295 m_fileListWidgets.clear();
297 m_controlPointEditViewWidget.clear();
298 m_matrixViewWidgets.clear();
299 m_sensorInfoWidgets.clear();
300 m_targetInfoWidgets.clear();
302 m_jigsawRunWidget.clear();
303
304 m_projectItemModel->clean();
305 }
306
307
317
318 if (m_recentProjectsLoaded) {
319 QMenu *recentProjectsMenu = new QMenu("&Recent Projects");
320
321 foreach (QAction *action, m_fileMenuActions) {
322
323 QString actionText(action->text());
324 if (actionText == "&Recent Projects") {
325 // Grab the pointer to the actual ""&Recent Projects" menu in IPCE
326 recentProjectsMenu = qobject_cast<QMenu*>(action->parentWidget());
327 break;
328 }
329 }
330
331 QString projName = m_recentProjects.at(0).split("/").last();
332
333 QAction *openRecentProjectAction = m_openProjectWorkOrder->clone();
334 openRecentProjectAction->setText(projName);
335 openRecentProjectAction->setToolTip(m_recentProjects.at(0));
336
337 if (recentProjectsMenu->isEmpty())
338 {
339 recentProjectsMenu->addAction(openRecentProjectAction);
340 return;
341 }
342
343 QAction *firstAction = recentProjectsMenu->actions().at(0);
344
345 // If the opened project is already the most recent project, return.
346 if (firstAction->text() == projName) {
347 return;
348 }
349
350 // If the action we're placing at the first index already exists,
351 // Then point to that action.
352 foreach (QAction *action, recentProjectsMenu->actions()) {
353 if (action->text() == projName) {
354 openRecentProjectAction = action;
355 break;
356 }
357 }
358
359 recentProjectsMenu->insertAction(firstAction, openRecentProjectAction);
360 if (recentProjectsMenu->actions().length() > Project::maxRecentProjects()) {
361 recentProjectsMenu->removeAction(recentProjectsMenu->actions().last());
362 }
363 }
364 else {
365
366 QMenu *fileMenu = new QMenu();
367 QMenu *recentProjectsMenu = fileMenu->addMenu("&Recent Projects");
368 int nRecentProjects = m_recentProjects.size();
369
370 for (int i = 0; i < nRecentProjects; i++) {
371 FileName projectFileName = m_recentProjects.at(i);
372
373 if (!projectFileName.fileExists() )
374 continue;
375
376 QAction *openRecentProjectAction = m_openProjectWorkOrder->clone();
377
378 if ( !( (OpenProjectWorkOrder*)openRecentProjectAction )
379 ->isExecutable(m_recentProjects.at(i),true ) )
380 continue;
381
382
383 QString projName = m_recentProjects.at(i).split("/").last();
384 openRecentProjectAction->setText(m_recentProjects.at(i).split("/").last() );
385 openRecentProjectAction->setToolTip(m_recentProjects.at(i));
386 recentProjectsMenu->addAction(openRecentProjectAction);
387 }
388 fileMenu->addSeparator();
389 m_fileMenuActions.append( fileMenu->actions() );
390 m_recentProjectsLoaded = true;
391 }
392 }
393
394
407 // Menus are created temporarily to convinently organize the actions.
408 QMenu *fileMenu = new QMenu();
409
410 //fileMenu->addAction(m_importControlNetWorkOrder->clone());
411 //fileMenu->addAction(m_importImagesWorkOrder->clone());
412
413 QAction *openProjectAction = m_openProjectWorkOrder->clone();
414 openProjectAction->setIcon(QIcon(FileName(
415 "$ISISROOT/appdata/images/icons/archive-insert-directory.png").expanded()));
416 fileMenu->addAction(openProjectAction);
417 m_permToolBarActions.append(openProjectAction);
418
419
420 QAction *saveAction = m_saveProjectWorkOrder->clone();
421 saveAction->setShortcut(Qt::Key_S | Qt::CTRL);
422 saveAction->setIcon( QIcon(FileName("$ISISROOT/appdata/images/icons/document-save.png")
423 .expanded()));
424 saveAction->setDisabled(true);
425 connect( project()->undoStack(), SIGNAL( cleanChanged(bool) ),
426 saveAction, SLOT( setDisabled(bool) ) );
427 fileMenu->addAction(saveAction);
428 m_permToolBarActions.append(saveAction);
429
430 QAction *saveAsAction = m_saveProjectAsWorkOrder->clone();
431 saveAsAction->setIcon(QIcon(FileName("$ISISROOT/appdata/images/icons/document-save-as.png")
432 .expanded()));
433 fileMenu->addAction(saveAsAction);
434 m_permToolBarActions.append(saveAsAction);
435
436 fileMenu->addSeparator();
437
438 QMenu *importMenu = fileMenu->addMenu("&Import");
439 importMenu->addAction(m_importControlNetWorkOrder->clone() );
440 importMenu->addAction(m_importImagesWorkOrder->clone() );
441 importMenu->addAction(m_importShapesWorkOrder->clone() );
442
443 QMenu *importTemplateMenu = importMenu->addMenu("&Import Templates");
444 importTemplateMenu->addAction(m_importMapTemplateWorkOrder->clone() );
445 importTemplateMenu->addAction(m_importRegistrationTemplateWorkOrder->clone() );
446
447 QMenu *exportMenu = fileMenu->addMenu("&Export");
448
449 // Temporarily grab the export control network clone so we can listen for the
450 // signals that tell us when we can export a cnet. We cannot export a cnet unless at least
451 // one has been imported to the project.
452 WorkOrder *clone = m_exportControlNetWorkOrder->clone();
453 clone->setEnabled(false);
454 connect(m_project, SIGNAL(controlListAdded(ControlList *)),
455 clone, SLOT(enableWorkOrder()));
456 // TODO this is not setup yet
457 // connect(m_project, &Project::allControlsRemoved,
458 // clone, &WorkOrder::disableWorkOrder);
459 exportMenu->addAction(clone);
460
461 // Similarly for export images, disable the work order until we have images in the project.
462 clone = m_exportImagesWorkOrder->clone();
463 clone->setEnabled(false);
464 connect(m_project, SIGNAL(imagesAdded(ImageList *)),
465 clone, SLOT(enableWorkOrder()));
466 exportMenu->addAction(clone);
467
468 fileMenu->addSeparator();
469 fileMenu->addAction(m_closeProjectWorkOrder->clone() );
470 m_fileMenuActions.append( fileMenu->actions() );
471
473
474 // For JigsawWorkOrder, disable the work order utnil we have both an active control and image
475 // list. Setup a tool tip so user can see why the work order is disabled by default.
476 // NOTE: Trying to set a what's this on the clone doesn't seem to work for disabled actions,
477 // even though Qt's documentation says it should work on disabled actions.
478 clone = m_runJigsawWorkOrder->clone();
479 if (project()->controls().count() && project()->images().count()) {
480 clone->setEnabled(true);
481 }
482 else {
483 clone->setEnabled(false);
484 }
485
486 // Listen for when both images and control net have been added to the project.
487 connect(m_project, SIGNAL(controlsAndImagesAvailable()),
488 clone, SLOT(enableWorkOrder()));
489 // Listen for when both an active control and active image list have been set.
490 // When this happens, we can enable the JigsawWorkOrder.
491// connect(m_project, &Project::activeControlAndImageListSet,
492// clone, &WorkOrder::enableWorkOrder);
493
494 m_projectMenuActions.append(clone);
495
496// m_projectMenuActions.append( projectMenu->actions() );
497
498 m_editMenuActions = QList<QAction *>();
499 m_viewMenuActions = QList<QAction *>();
500 m_settingsMenuActions = QList<QAction *>();
501 m_helpMenuActions = QList<QAction *>();
502 }
503
504
510 if (!m_historyTreeWidget) {
512 }
513 historyContainer->setWidget(m_historyTreeWidget);
514 }
515
516
522 if (!m_warningTreeWidget) {
524 }
525 warningContainer->setWidget(m_warningTreeWidget);
526 }
527
528
534
535 m_recentProjects.append(recentProjects);
536 }
537
538
548
549 foreach(CnetEditorView *cnetEditorView, m_cnetEditorViewWidgets) {
550 if (cnetEditorView->control() == project()->activeControl()) {
551 emit closeView(cnetEditorView);
552 addCnetEditorView(project()->activeControl());
553 }
554 }
555 }
556
557
565 void Directory::newActiveControl(bool newControl) {
566
567 if (newControl && m_controlPointEditViewWidget) {
568 emit closeView(m_controlPointEditViewWidget);
569 delete m_controlPointEditViewWidget;
570 }
571
572 // If the new active control is the same as what is showing in the cnetEditorWidget, allow
573 // editing of control points from the widget, otherwise turnoff from context menu
574 foreach(CnetEditorView *cnetEditorView, m_cnetEditorViewWidgets) {
575 if (cnetEditorView->control() == project()->activeControl()) {
576 cnetEditorView->cnetEditorWidget()->pointTableView()->content()->setActiveControlNet(true);
577 cnetEditorView->cnetEditorWidget()->measureTableView()->content()->setActiveControlNet(true);
578 }
579 else {
580 cnetEditorView->cnetEditorWidget()->pointTableView()->content()->setActiveControlNet(false);
581 cnetEditorView->cnetEditorWidget()->measureTableView()->content()->setActiveControlNet(false);
582 }
583 }
584 }
585
586
594
595
601 BundleObservationView *result = new BundleObservationView(fileItem);
602
603 connect( result, SIGNAL( destroyed(QObject *) ),
604 this, SLOT( cleanupBundleObservationViews(QObject *) ) );
605
606 connect(result, SIGNAL(windowChangeEvent(bool)),
607 m_project, SLOT(setClean(bool)));
608
609 m_bundleObservationViews.append(result);
610
611 QString str = fileItem->fileName();
612 FileName fileName = fileItem->fileName();
613
614 // strip out bundle results name from fileName
615 QString path = fileName.originalPath();
616 int pos = path.lastIndexOf("/");
617 QString bundleResultsName = "";
618 if (pos != -1) {
619 bundleResultsName = path.remove(0,pos+1);
620 }
621
622 if (str.contains("bundleout")) {
623 result->setWindowTitle( tr("Summary (%1)").
624 arg( bundleResultsName ) );
625 result->setObjectName( result->windowTitle() );
626 }
627 if (str.contains("residuals")) {
628 result->setWindowTitle( tr("Measure Residuals (%1)").
629 arg( bundleResultsName ) );
630 result->setObjectName( result->windowTitle() );
631 }
632 else if (str.contains("points")) {
633 result->setWindowTitle( tr("Control Points (%1)").
634 arg( bundleResultsName ) );
635 result->setObjectName( result->windowTitle() );
636 }
637 else if (str.contains("images")) {
638 result->setWindowTitle( tr("Images (%1)").
639 arg( bundleResultsName ) );
640 result->setObjectName( result->windowTitle() );
641 }
642
643 emit newWidgetAvailable(result);
644
645 return result;
646 }
647
648
654 CnetEditorView *Directory::addCnetEditorView(Control *control, QString objectName) {
655
656 QString title = tr("Cnet Editor View %1").arg( control->displayProperties()->displayName() );
657 FileName configFile("$HOME/.Isis/" + QApplication::applicationName() + "/" + title + ".config");
658
659 CnetEditorView *result = new CnetEditorView(this, control, configFile);
660
661 if (project()->activeControl() && (control == project()->activeControl())) {
664 }
665
666 // connect destroyed signal to cleanupCnetEditorViewWidgets slot
667 connect(result, SIGNAL( destroyed(QObject *) ),
668 this, SLOT( cleanupCnetEditorViewWidgets(QObject *) ) );
669
670 connect(result, SIGNAL(windowChangeEvent(bool)),
671 m_project, SLOT(setClean(bool)));
672
673 // Connections for control point editing between views
674 connect(result->cnetEditorWidget(), SIGNAL(editControlPoint(ControlPoint *, QString)),
675 this, SLOT(modifyControlPoint(ControlPoint *, QString)));
676
677 // If a cnet is modified, we have to set the clean state in project and redraw measures.
678 connect(result->cnetEditorWidget(), SIGNAL(cnetModified()), this, SIGNAL(cnetModified()));
679 connect(this, SIGNAL(cnetModified()), result->cnetEditorWidget(), SLOT(rebuildModels()));
680
681 m_cnetEditorViewWidgets.append(result);
682 m_controlMap.insert(control, result);
683
684 result->setWindowTitle(title);
685 if (objectName != "") {
686 result->setObjectName(objectName);
687 }
688 else {
689 // If no objectName, create unique identifier
690 QString newObjectName = QUuid::createUuid().toString().remove(QRegExp("[{}]"));
691 result->setObjectName(newObjectName);
692 }
693
694 emit newWidgetAvailable(result);
695
696 return result;
697 }
698
699
705 CubeDnView *result = new CubeDnView(this, qobject_cast<QMainWindow *>(parent()));
707 m_cubeDnViewWidgets.append(result);
708 connect( result, SIGNAL( destroyed(QObject *) ),
709 this, SLOT( cleanupCubeDnViewWidgets(QObject *) ) );
710
711 connect(result, SIGNAL(windowChangeEvent(bool)),
712 m_project, SLOT(setClean(bool)));
713
714 result->setWindowTitle( tr("Cube DN View %1").arg(m_cubeDnViewWidgets.count() ) );
715 // Unique objectNames are needed for the save/restoreState
716 if (objectName != "") {
717 result->setObjectName(objectName);
718 }
719 else {
720 // If no objectName, create unique identifier
721 QString newObjectName = QUuid::createUuid().toString().remove(QRegExp("[{}]"));
722 result->setObjectName(newObjectName);
723 }
724
725 emit newWidgetAvailable(result);
726
727 // Connections between mouse button events from view and control point editing
728 connect(result, SIGNAL(modifyControlPoint(ControlPoint *, QString)),
729 this, SLOT(modifyControlPoint(ControlPoint *, QString)));
730
731 connect(result, SIGNAL(deleteControlPoint(ControlPoint *)),
732 this, SLOT(deleteControlPoint(ControlPoint *)));
733
734 connect(result, SIGNAL(createControlPoint(double, double, Cube *, bool)),
735 this, SLOT(createControlPoint(double, double, Cube *, bool)));
736
737 // This signal is connected to the CubeDnView signal which connects to the slot,
738 // ControlNetTool::paintAllViewports(). ControlNetTool always redraws all control points, so
739 // both signals go to the same slot.
740 connect(this, SIGNAL(redrawMeasures()), result, SIGNAL(redrawMeasures()));
741
742 // If the active cnet is modified, redraw the measures
743 connect(this, SIGNAL(activeControlModified()), result, SIGNAL(redrawMeasures()));
744
745 connect (project(), SIGNAL(activeControlSet(bool)),
746 result, SLOT(enableControlNetTool(bool)));
747
748 return result;
749 }
750
756 Footprint2DView *result = new Footprint2DView(this);
757
758 // Set source model on Proxy
760 m_footprint2DViewWidgets.append(result);
761 result->setWindowTitle( tr("Footprint View %1").arg( m_footprint2DViewWidgets.count() ) );
762 // Unique objectNames are needed for the save/restoreState
763 if (objectName != "") {
764 result->setObjectName(objectName);
765 }
766 else {
767 // If no objectName, create unique identifier
768 QString newObjectName = QUuid::createUuid().toString().remove(QRegExp("[{}]"));
769 result->setObjectName(newObjectName);
770 }
771
772 connect(result, SIGNAL(destroyed(QObject *)),
774
775 connect(result, SIGNAL(windowChangeEvent(bool)),
776 m_project, SLOT(setClean(bool)));
777
778 emit newWidgetAvailable(result);
779
780 // Connections between mouse button events from footprint2DView and control point editing
781 connect(result, SIGNAL(modifyControlPoint(ControlPoint *)),
782 this, SLOT(modifyControlPoint(ControlPoint *)));
783
784 connect(result, SIGNAL(deleteControlPoint(ControlPoint *)),
785 this, SLOT(deleteControlPoint(ControlPoint *)));
786
787 connect(result, SIGNAL(createControlPoint(double, double)),
788 this, SLOT(createControlPoint(double, double)));
789
790 // The ControlPointEditWidget is only object that emits cnetModified when ControlPoint is
791 // deleted or saved. This requires the footprint view ControlNetGraphicsItems to be re-built
792 // when the active cnet is modified.
793 connect(this, SIGNAL(activeControlModified()), result->mosaicSceneWidget(), SIGNAL(cnetModified()));
794
795 // This signal is connected to the MosaicGraphicsScene::update(), which eventually calls
796 // ControlNetGraphicsItem::paint(), then ControlPointGraphicsItem::paint(). This should only
797 // be used if ControlNet has not changed. Used to update the current edit point in the view
798 // to be drawn with different color/shape.
799 connect(this, SIGNAL(redrawMeasures()), result, SIGNAL(redrawMeasures()));
800
801 connect (project(), SIGNAL(activeControlSet(bool)),
802 result, SLOT(enableControlNetTool(bool)));
803
804 return result;
805 }
806
807 ControlHealthMonitorView *Directory::controlHealthMonitorView() {
808 return m_controlHealthMonitorView;
809 }
810
811
812 ControlHealthMonitorView *Directory::addControlHealthMonitorView() {
813
814 if (!controlHealthMonitorView()) {
815
816 Control *activeControl = project()->activeControl();
817 if (activeControl == NULL) {
818 QString message = "No active control network chosen. Choose active control network on "
819 "project tree.\n";
820 QMessageBox::critical(qobject_cast<QWidget *>(parent()), "Error", message);
821 return NULL;
822 }
823
825 result->setWindowTitle(tr("Control NetHealth Monitor"));
826 result->setObjectName(result->windowTitle());
827
828 m_controlHealthMonitorView = result;
829 emit newWidgetAvailable(result);
830 }
831 return controlHealthMonitorView();
832 }
833
834
835 ControlPointEditView *Directory::addControlPointEditView() {
836
837 if (!controlPointEditView()) {
838 // TODO Need parent for controlPointWidget
839 ControlPointEditView *result = new ControlPointEditView(this);
840 result->setWindowTitle(tr("Control Point Editor"));
841 result->setObjectName(result->windowTitle());
842
843 Control *activeControl = project()->activeControl();
844 if (activeControl == NULL) {
845 // Error and return to Select Tool
846 QString message = "No active control network chosen. Choose active control network on "
847 "project tree.\n";
848 QMessageBox::critical(qobject_cast<QWidget *>(parent()), "Error", message);
849 return NULL;
850 }
851 result->controlPointEditWidget()->setControl(activeControl);
852
853 if (!project()->activeImageList() || !project()->activeImageList()->serialNumberList()) {
854 QString message = "No active image list chosen. Choose an active image list on the project "
855 "tree.\n";
856 QMessageBox::critical(qobject_cast<QWidget *>(parent()), "Error", message);
857 return NULL;
858 }
860 project()->activeImageList()->serialNumberList());
861
862 m_controlPointEditViewWidget = result;
863
864 connect(result, SIGNAL(destroyed(QObject *)),
866 emit newWidgetAvailable(result);
867
868// 2017-06-09 Ken commented out for Data Workshop demo
869// m_chipViewports = new ChipViewportsWidget(result);
870// connect(m_chipViewports, SIGNAL(destroyed(QObject *)), this, SLOT(cleanupchipViewportWidges()));
871// m_chipViewports->setWindowTitle(tr("ChipViewport View"));
872// m_chipViewports->setObjectName(m_chipViewports->windowTitle());
873// m_chipViewports->setSerialNumberList(project()->activeImageList()->serialNumberList());
874// m_chipViewports->setControlNet(activeControl->controlNet(), activeControl->fileName());
875// emit newWidgetAvailable(m_chipViewports);
876// 2017-06-09 Ken commented out for Data Workshop demo
877
878
879 // Create connections between signals from control point edit view and equivalent directory
880 // signals that can then be connected to other views that display control nets.
881 // If the active was modified, this will be signaled in project's cnetModified() and
882 // connected to other views to redraw themselves.
883 connect(result->controlPointEditWidget(), SIGNAL(cnetModified()),
884 this, SIGNAL(cnetModified()));
885
886 connect (project(), SIGNAL(activeControlSet(bool)),
887 result->controlPointEditWidget(), SLOT(setControlFromActive()));
888
889 connect(result, SIGNAL(windowChangeEvent(bool)),
890 m_project, SLOT(setClean(bool)));
891
892 // Recolors the save net button in controlPointEditView to black after the cnets are saved.
893 connect(m_project, SIGNAL(cnetSaved(bool)),
894 result->controlPointEditWidget(), SLOT(colorizeSaveNetButton(bool)));
895 }
896
897 return controlPointEditView();
898 }
899
900
901
902
903#if 0
904 ChipViewportsWidget *Directory::addControlPointChipView() {
905
906 ChipViewportsWidget *result = new ChipViewportsWidget(this);
907 connect(result, SIGNAL(destroyed(QObject *)), this, SLOT(cleanupchipViewportWidges()));
908 m_controlPointChipViews.append(result);
909 result->setWindowTitle(tr("ChipViewport View %1").arg(m_controlPointChipViews.count()));
910 result->setObjectName(result->windowTitle());
911 emit newWidgetAvailable(result);
912
913 return result;
914 }
915#endif
916
917
923 MatrixSceneWidget *result = new MatrixSceneWidget(NULL, true, true, this);
924
925 connect( result, SIGNAL( destroyed(QObject *) ),
926 this, SLOT( cleanupMatrixViewWidgets(QObject *) ) );
927
928 m_matrixViewWidgets.append(result);
929
930 result->setWindowTitle( tr("Matrix View %1").arg( m_matrixViewWidgets.count() ) );
931 result->setObjectName( result->windowTitle() );
932
933 emit newWidgetAvailable(result);
934
935 return result;
936 }
937
938
944 TargetInfoWidget *result = new TargetInfoWidget(target.data(), this);
945
946 connect( result, SIGNAL( destroyed(QObject *) ),
947 this, SLOT( cleanupTargetInfoWidgets(QObject *) ) );
948
949 m_targetInfoWidgets.append(result);
950
951 result->setWindowTitle( tr("%1").arg(target->displayProperties()->displayName() ) );
952 result->setObjectName( result->windowTitle() );
953
954 emit newWidgetAvailable(result);
955
956 return result;
957 }
958
959
965 TemplateEditorWidget *result = new TemplateEditorWidget(currentTemplate, this);
966
967 connect( result, SIGNAL( destroyed(QObject *) ),
968 this, SLOT( cleanupTemplateEditorWidgets(QObject *) ) );
969
970 m_templateEditorWidgets.append(result);
971
972 result->setWindowTitle( tr("%1").arg( FileName(currentTemplate->fileName()).name() ) );
973 result->setObjectName( result->windowTitle() );
974
975 emit newWidgetAvailable(result);
976
977 return result;
978 }
979
980 JigsawRunWidget *Directory::addJigsawRunWidget() {
981 if (jigsawRunWidget()) {
982 return m_jigsawRunWidget;
983 }
985
986 connect( result, SIGNAL( destroyed(QObject *) ),
987 this, SLOT( cleanupJigsawRunWidget(QObject *) ) );
988 m_jigsawRunWidget = result;
989
990 result->setAttribute(Qt::WA_DeleteOnClose);
991 result->show();
992
993 emit newWidgetAvailable(result);
994 return result;
995 }
996
997
1003 SensorInfoWidget *result = new SensorInfoWidget(camera.data(), this);
1004
1005 connect( result, SIGNAL( destroyed(QObject *) ),
1006 this, SLOT( cleanupSensorInfoWidgets(QObject *) ) );
1007
1008 m_sensorInfoWidgets.append(result);
1009
1010 result->setWindowTitle( tr("%1").arg(camera->displayProperties()->displayName() ) );
1011 result->setObjectName( result->windowTitle() );
1012
1013 emit newWidgetAvailable(result);
1014
1015 return result;
1016 }
1017
1018
1025 ImageFileListWidget *result = new ImageFileListWidget(this);
1026
1027 connect( result, SIGNAL( destroyed(QObject *) ),
1028 this, SLOT( cleanupFileListWidgets(QObject *) ) );
1029
1030 m_fileListWidgets.append(result);
1031
1032 result->setWindowTitle( tr("File List %1").arg( m_fileListWidgets.count() ) );
1033 // Unique objectNames are needed for the save/restoreState
1034 if (objectName != "") {
1035 result->setObjectName(objectName);
1036 }
1037 else {
1038 // If no objectName, create unique identifier
1039 QString newObjectName = QUuid::createUuid().toString().remove(QRegExp("[{}]"));
1040 result->setObjectName(newObjectName);
1041 }
1042
1043 return result;
1044 }
1045
1046
1054 result->setWindowTitle( tr("Project"));
1055 result->setObjectName( result->windowTitle() );
1056
1057 // The model emits this signal when the user double-clicks on the project name, the parent
1058 // node located on the ProjectTreeView.
1059 connect(m_projectItemModel, SIGNAL(projectNameEdited(QString)),
1060 this, SLOT(initiateRenameProjectWorkOrder(QString)));
1061
1062 connect(result, SIGNAL(windowChangeEvent(bool)),
1063 m_project, SLOT(setClean(bool)));
1064
1065 return result;
1066 }
1067
1068
1077
1078 // Create the WorkOrder and add it to the Project. The Project will then execute the
1079 // WorkOrder.
1080 RenameProjectWorkOrder *workOrder = new RenameProjectWorkOrder(projectName, project());
1081 project()->addToProject(workOrder);
1082 }
1083
1084
1092
1093
1101
1102
1107
1108 BundleObservationView *bundleObservationView = static_cast<BundleObservationView *>(obj);
1109 if (!bundleObservationView) {
1110 return;
1111 }
1112 m_bundleObservationViews.removeAll(bundleObservationView);
1113 m_project->setClean(false);
1114 }
1115
1116 // /**
1117 // * @brief Removes pointers to deleted Control Health Monitor objects.
1118 // */
1119 // void Directory::cleanupControlHealthMonitorView(QObject *obj) {
1120 //
1121 // ControlHealthMonitorView *healthMonitorView = static_cast<ControlHealthMonitorView *>(obj);
1122 // if (!healthMonitorView) {
1123 // return;
1124 // }
1125 //
1126 // m_project->setClean(false);
1127 // }
1128
1129
1134
1135 CnetEditorView *cnetEditorView = static_cast<CnetEditorView *>(obj);
1136 if (!cnetEditorView) {
1137 return;
1138 }
1139
1140 Control *control = m_controlMap.key(cnetEditorView);
1141 m_controlMap.remove(control, cnetEditorView);
1142
1143 if ( m_controlMap.count(control) == 0 && project()->activeControl() != control) {
1144 control->closeControlNet();
1145 }
1146
1147 m_cnetEditorViewWidgets.removeAll(cnetEditorView);
1148 m_project->setClean(false);
1149 }
1150
1151
1160
1161 bool result;
1162 if ( m_controlMap.count(control) == 0) {
1163 result = false;
1164 }
1165 else {
1166 result = true;
1167 }
1168 return result;
1169 }
1170
1171
1176
1177 CubeDnView *cubeDnView = static_cast<CubeDnView *>(obj);
1178 if (!cubeDnView) {
1179 return;
1180 }
1181 m_cubeDnViewWidgets.removeAll(cubeDnView);
1182 m_project->setClean(false);
1183 }
1184
1185
1190
1191 ImageFileListWidget *imageFileListWidget = static_cast<ImageFileListWidget *>(obj);
1192 if (!imageFileListWidget) {
1193 return;
1194 }
1195 m_fileListWidgets.removeAll(imageFileListWidget);
1196 m_project->setClean(false);
1197 }
1198
1199
1204
1205 Footprint2DView *footprintView = static_cast<Footprint2DView *>(obj);
1206 if (!footprintView) {
1207 return;
1208 }
1209 m_footprint2DViewWidgets.removeAll(footprintView);
1210 m_project->setClean(false);
1211 }
1212
1213
1218
1220 if (!controlPointEditView) {
1221 return;
1222 }
1223 m_controlPointEditViewWidget = NULL;
1224 m_project->setClean(false);
1225
1226 }
1227
1228
1233
1234 MatrixSceneWidget *matrixWidget = static_cast<MatrixSceneWidget *>(obj);
1235 if (!matrixWidget) {
1236 return;
1237 }
1238 m_matrixViewWidgets.removeAll(matrixWidget);
1239 m_project->setClean(false);
1240 }
1241
1242
1247
1248 SensorInfoWidget *sensorInfoWidget = static_cast<SensorInfoWidget *>(obj);
1249 if (!sensorInfoWidget) {
1250 return;
1251 }
1252 m_sensorInfoWidgets.removeAll(sensorInfoWidget);
1253 m_project->setClean(false);
1254 }
1255
1256
1261
1262 TargetInfoWidget *targetInfoWidget = static_cast<TargetInfoWidget *>(obj);
1263 if (!targetInfoWidget) {
1264 return;
1265 }
1266 m_targetInfoWidgets.removeAll(targetInfoWidget);
1267 m_project->setClean(false);
1268 }
1269
1270
1275
1276 TemplateEditorWidget *templateEditorWidget = static_cast<TemplateEditorWidget *>(obj);
1277 if (!templateEditorWidget) {
1278 return;
1279 }
1280
1281 m_templateEditorWidgets.removeAll(templateEditorWidget);
1282 m_project->setClean(false);
1283 }
1284
1285
1286 void Directory::cleanupJigsawRunWidget(QObject *obj) {
1287 JigsawRunWidget *jigsawRunWidget = static_cast<JigsawRunWidget *>(obj);
1288 if (!jigsawRunWidget) {
1289 return;
1290 }
1291 m_jigsawRunWidget = NULL;
1292 }
1293
1294
1301 m_recentProjects.insert( 0, project->projectRoot() );
1302 }
1303
1304
1310 return m_project;
1311 }
1312
1313
1318 QList<CnetEditorView *> Directory::cnetEditorViews() {
1319 QList<CnetEditorView *> results;
1320
1321 foreach (CnetEditorView *widget, m_cnetEditorViewWidgets) {
1322 results.append(widget);
1323 }
1324
1325 return results;
1326 }
1327
1328
1333 QList<CubeDnView *> Directory::cubeDnViews() {
1334 QList<CubeDnView *> results;
1335
1336 foreach (CubeDnView *widget, m_cubeDnViewWidgets) {
1337 results.append(widget);
1338 }
1339
1340 return results;
1341 }
1342
1343
1348 QList<MatrixSceneWidget *> Directory::matrixViews() {
1349 QList<MatrixSceneWidget *> results;
1350
1351 foreach (MatrixSceneWidget *widget, m_matrixViewWidgets) {
1352 results.append(widget);
1353 }
1354
1355 return results;
1356 }
1357
1358
1363 QList<SensorInfoWidget *> Directory::sensorInfoViews() {
1364 QList<SensorInfoWidget *> results;
1365
1366 foreach (SensorInfoWidget *widget, m_sensorInfoWidgets) {
1367 results.append(widget);
1368 }
1369
1370 return results;
1371 }
1372
1373
1378 QList<TargetInfoWidget *> Directory::targetInfoViews() {
1379 QList<TargetInfoWidget *> results;
1380
1381 foreach (TargetInfoWidget *widget, m_targetInfoWidgets) {
1382 results.append(widget);
1383 }
1384
1385 return results;
1386 }
1387
1388
1393 QList<TemplateEditorWidget *> Directory::templateEditorViews() {
1394 QList<TemplateEditorWidget *> results;
1395
1397 results.append(widget);
1398 }
1399
1400 return results;
1401 }
1402
1403
1408 QList<Footprint2DView *> Directory::footprint2DViews() {
1409 QList<Footprint2DView *> results;
1410
1411 foreach (Footprint2DView *view, m_footprint2DViewWidgets) {
1412 results.append(view);
1413 }
1414
1415 return results;
1416 }
1417
1418
1423 QList<ImageFileListWidget *> Directory::imageFileListViews() {
1424 QList<ImageFileListWidget *> results;
1425
1426 foreach (ImageFileListWidget *widget, m_fileListWidgets) {
1427 results.append(widget);
1428 }
1429
1430 return results;
1431 }
1432
1438
1439 return m_controlPointEditViewWidget;
1440 }
1441
1442
1443 JigsawRunWidget *Directory::jigsawRunWidget() {
1444
1445 return m_jigsawRunWidget;
1446 }
1447
1448
1449/*
1450 ChipViewportsWidget *Directory::controlPointChipViewports() {
1451
1452 return m_chipViewports;
1453 }
1454*/
1455
1460//ControlNetEditor *Directory::controlNetEditor() {
1461// return m_cnetEditor;
1462//}
1463
1464
1469 QList<QProgressBar *> Directory::progressBars() {
1470 QList<QProgressBar *> result;
1471 return result;
1472 }
1473
1474
1479 void Directory::showWarning(QString text) {
1480 m_warningTreeWidget->showWarning(text);
1481 emit newWarning();
1482 }
1483
1484
1490 return project()->undoStack()->createRedoAction(this);
1491 }
1492
1493
1499 return project()->undoStack()->createUndoAction(this);
1500 }
1501
1502
1512 void Directory::save(QXmlStreamWriter &stream, FileName newProjectRoot) const {
1513 stream.writeStartElement("directory");
1514
1515 if ( !m_fileListWidgets.isEmpty() ) {
1516 stream.writeStartElement("fileListWidgets");
1517
1518 foreach (ImageFileListWidget *fileListWidget, m_fileListWidgets) {
1519 fileListWidget->save(stream, project(), newProjectRoot);
1520 }
1521
1522 stream.writeEndElement();
1523 }
1524
1525 // Save footprints
1526 if ( !m_footprint2DViewWidgets.isEmpty() ) {
1527 stream.writeStartElement("footprintViews");
1528
1529 foreach (Footprint2DView *footprint2DViewWidget, m_footprint2DViewWidgets) {
1530 footprint2DViewWidget->save(stream, project(), newProjectRoot);
1531 }
1532
1533 stream.writeEndElement();
1534 }
1535
1536 // Save cubeDnViews
1537 if ( !m_cubeDnViewWidgets.isEmpty() ) {
1538 stream.writeStartElement("cubeDnViews");
1539
1540 foreach (CubeDnView *cubeDnView, m_cubeDnViewWidgets) {
1541 cubeDnView->save(stream, project(), newProjectRoot);
1542 }
1543
1544 stream.writeEndElement();
1545 }
1546
1547 // Save cnetEditorViews
1548 if ( !m_cnetEditorViewWidgets.isEmpty() ) {
1549 stream.writeStartElement("cnetEditorViews");
1550
1551 foreach (CnetEditorView *cnetEditorWidget, m_cnetEditorViewWidgets) {
1552 cnetEditorWidget->save(stream, project(), newProjectRoot);
1553 }
1554
1555 stream.writeEndElement();
1556 }
1557
1558
1559 stream.writeEndElement();
1560 }
1561
1562
1624 QList< QPair< QString, QList<QAction *> > > actionPairings) {
1625 QList<QAction *> results;
1626
1627 QStringList sortedActionTexts;
1628
1629 // This is a map from the Action Text to the actions and their widget titles
1630 QMap< QString, QList< QPair<QString, QAction *> > > restructuredData;
1631
1632 QPair< QString, QList<QAction *> > singleWidgetPairing;
1633 foreach (singleWidgetPairing, actionPairings) {
1634 QString widgetTitle = singleWidgetPairing.first;
1635 QList<QAction *> widgetActions = singleWidgetPairing.second;
1636
1637 foreach (QAction *widgetAction, widgetActions) {
1638 if (widgetAction) {
1639 QString actionText = widgetAction->text();
1640
1641 restructuredData[actionText].append( qMakePair(widgetTitle, widgetAction) );
1642
1643 if ( !sortedActionTexts.contains(actionText) ) {
1644 sortedActionTexts.append(actionText);
1645 }
1646 }
1647 else {
1648 // Add separator
1649 if ( !sortedActionTexts.isEmpty() && !sortedActionTexts.last().isEmpty() ) {
1650 sortedActionTexts.append("");
1651 }
1652 }
1653 }
1654 }
1655
1656 if ( sortedActionTexts.count() && sortedActionTexts.last().isEmpty() ) {
1657 sortedActionTexts.removeLast();
1658 }
1659
1660 foreach (QString actionText, sortedActionTexts) {
1661 if ( actionText.isEmpty() ) {
1662 results.append(NULL);
1663 }
1664 else {
1665 // We know this list isn't empty because we always appended to the value when we
1666 // accessed a particular key.
1667 QList< QPair<QString, QAction *> > actions = restructuredData[actionText];
1668
1669 if (actions.count() == 1) {
1670 QAction *finalAct = actions.first().second;
1671 QString widgetTitle = actions.first().first;
1672
1673 finalAct->setText( tr("%1 on %2").arg(actionText).arg(widgetTitle) );
1674 results.append(finalAct);
1675 }
1676 else {
1677 QAction *menuAct = new QAction(actionText, NULL);
1678
1679 QMenu *menu = new QMenu;
1680 menuAct->setMenu(menu);
1681
1682 QList<QAction *> actionsInsideMenu;
1683
1684 QPair<QString, QAction *> widgetTitleAndAction;
1685 foreach (widgetTitleAndAction, actions) {
1686 QString widgetTitle = widgetTitleAndAction.first;
1687 QAction *action = widgetTitleAndAction.second;
1688
1689 action->setText(widgetTitle);
1690 actionsInsideMenu.append(action);
1691 }
1692
1693 std::sort(actionsInsideMenu.begin(), actionsInsideMenu.end(), &actionTextLessThan);
1694
1695 QAction *allAct = new QAction(tr("All"), NULL);
1696
1697 foreach (QAction *actionInMenu, actionsInsideMenu) {
1698 connect( allAct, SIGNAL( triggered() ),
1699 actionInMenu, SIGNAL( triggered() ) );
1700 menu->addAction(actionInMenu);
1701 }
1702
1703 menu->addSeparator();
1704 menu->addAction(allAct);
1705
1706 results.append(menuAct);
1707 }
1708 }
1709 }
1710
1711 return results;
1712 }
1713
1714
1724 return lhs->text().localeAwareCompare( rhs->text() ) < 0;
1725
1726 }
1727
1728
1733#if 0
1734 if (m_controlPointEditView && m_footprint2DViewWidgets.size() == 1) {
1735 connect(m_footprint2DViewWidgets.at(0), SIGNAL(controlPointSelected(ControlPoint *)),
1736 m_controlPointEdit, SLOT(loadControlPoint(ControlPoint *)));
1737 connect(m_cnetEditor, SIGNAL(controlPointCreated(ControlPoint *)),
1738 m_controlPointEditWidget, SLOT(setEditPoint(ControlPoint *)));
1739
1740 // MosaicControlTool->MosaicSceneWidget->ControlNetEditor
1741 connect( m_footprint2DViewWidgets.at(0), SIGNAL( deleteControlPoint(QString) ),
1742 m_cnetEditor, SLOT( deleteControlPoint(QString) ) );
1743 // ControlNetEditor->MosaicSceneWidget->MosaicControlTool
1744 connect( m_cnetEditor, SIGNAL( controlPointDeleted() ),
1745 m_footprint2DViewWidgets.at(0), SIGNAL( controlPointDeleted() ) );
1746
1747
1748 // TODO Figure out which footprint view has the "active" cnet.
1749 //qDebug() << "\t\tMos items: " << m_footprint2DViewWidgets.at(0);
1750 connect(m_controlPointEditWidget, SIGNAL(controlPointChanged(QString)),
1751 m_footprint2DViewWidgets.at(0), SIGNAL(controlPointChanged(QString)));
1752 }
1753#endif
1754 }
1755
1756
1766 void Directory::modifyControlPoint(ControlPoint *controlPoint, QString serialNumber) {
1767
1768 if (controlPoint) {
1769 if (!controlPointEditView()) {
1770 if (!addControlPointEditView()) {
1771 return;
1772 }
1773 }
1774 m_editPointId = controlPoint->GetId();
1775 emit redrawMeasures();
1776
1777 controlPointEditView()->controlPointEditWidget()->setEditPoint(controlPoint, serialNumber);
1778 }
1779 }
1780
1781
1789
1790 if (controlPoint) {
1791 if (!controlPointEditView()) {
1792 if (!addControlPointEditView()) {
1793 return;
1794 }
1795 }
1796 m_editPointId = controlPoint->GetId();
1797
1798 // Update views with point to be deleted shown as current edit point
1799 emit redrawMeasures();
1800
1802 }
1803 }
1804
1805
1819 void Directory::createControlPoint(double latitude, double longitude, Cube *cube,
1820 bool isGroundSource) {
1821
1822 if (!controlPointEditView()) {
1823 if (!addControlPointEditView()) {
1824 return;
1825 }
1826 }
1828 latitude, longitude, cube, isGroundSource);
1829
1831 }
1832
1833
1840 return m_editPointId;
1841 }
1842}
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
virtual void setModel(ProjectItemModel *model)
Sets the model used by the view.
View for displaying BundleObservation CSV files.
Scrolled widget for display ChipViewports.
Ipce view containing the CnetEditorWidget.
CnetEditorWidget * cnetEditorWidget()
Returns the cnetEditorWidget.
void save(QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const
This method saves the Controls object ids to the stream.
TableView * pointTableView()
Returns the point table view.
TableView * measureTableView()
Returns the measure table view.
View for the Control Net Health Monitor.
This represents an ISIS control net in a project-based GUI interface.
Definition Control.h:65
ControlDisplayProperties * displayProperties()
Access a pointer to the display properties for the control network.
Definition Control.cpp:232
void closeControlNet()
Cleans up the ControlNet pointer.
Definition Control.cpp:194
Maintains a list of Controls so that control nets can easily be copied from one Project to another,...
Definition ControlList.h:42
View for editing a single ControlPoint.
ControlPointEditWidget * controlPointEditWidget()
Returns the ControlPointEditWidget.
void deletePoint(ControlPoint *controlPoint)
Gives user options for deleting a control point from the control network.
void setEditPoint(ControlPoint *controlPoint, QString serialNumber="")
Slot called by Directory to set the control point for editing.
void setControl(Control *control)
New control network being edited.
void setSerialNumberList(SerialNumberList *snList)
Set the serial number list.
void createControlPoint(double latitude, double longitude, Cube *cube=0, bool isGroundSource=false)
Create a new control point at the given latitude, longitude.
A single control point.
QString GetId() const
Return the Id of the control point.
View that displays cubes in a QView-like way.
Definition CubeDnView.h:95
IO Handler for Isis Cubes.
Definition Cube.h:168
QString m_editPointId
Current control point that is in the ControlPointEditWidget.
Definition Directory.h:522
ProjectItemTreeView * addProjectItemTreeView()
Adds a ProjectItemTreeView to the window.
QPointer< WorkOrder > m_importMapTemplateWorkOrder
The Import Map Template WorkOrder.
Definition Directory.h:503
void cleanupControlPointEditViewWidget(QObject *)
Delete the ControlPointEditWidget and set it's pointer to NULL.
QList< TemplateEditorWidget * > templateEditorViews()
Accessor for the list of TemplateEditorWidgets currently available.
QPointer< WorkOrder > m_importShapesWorkOrder
The import shapes WorkOrder.
Definition Directory.h:497
QPointer< WorkOrder > m_exportImagesWorkOrder
The export images WorkOrder.
Definition Directory.h:494
void reloadActiveControlInCnetEditorView()
@description This slot was created specifically for the CnetEditorWidgets when user chooses a new act...
QList< SensorInfoWidget * > sensorInfoViews()
Accessor for the list of SensorInfoWidgets currently available.
void updateRecentProjects()
Loads and displays a list of recently opened projects in the file menu.
void cleanupFootprint2DViewWidgets(QObject *)
Removes pointers to deleted Footprint2DView objects.
void cleanupCnetEditorViewWidgets(QObject *)
Removes pointers to deleted CnetEditorWidget objects.
QList< QAction * > settingsMenuActions()
Get the list of actions that the Directory can provide for the settings menu.
QList< QPointer< CubeDnView > > m_cubeDnViewWidgets
List of CubeDnCiew obs.
Definition Directory.h:475
void setWarningContainer(QDockWidget *warningContainer)
Set up the warning info in the warning dockable widget.
QList< QAction * > m_settingsMenuActions
List of menu settings actions.
Definition Directory.h:513
void initiateRenameProjectWorkOrder(QString projectName)
Slot which is connected to the model's signal, projectNameEdited, which is emitted when the user doub...
QList< QAction * > m_fileMenuActions
List of file menu actions.
Definition Directory.h:509
void cleanupBundleObservationViews(QObject *)
Removes pointers to deleted BundleObservationView objects.
QList< Footprint2DView * > footprint2DViews()
Accessor for the list of Footprint2DViews currently available.
QList< QAction * > m_toolPadActions
List of ToolPad actions.
Definition Directory.h:518
MatrixSceneWidget * addMatrixView()
Add the matrix view widget to the window.
void updateControlNetEditConnections()
Updates the SIGNAL/SLOT connections for the cotrol net editor.
TemplateEditorWidget * addTemplateEditorView(Template *currentTemplate)
Add template editor view widget to the window.
QList< QAction * > fileMenuActions()
Get the list of actions that the Directory can provide for the file menu.
Directory(QObject *parent=0)
The Constructor.
void deleteControlPoint(ControlPoint *controlPoint)
Slot that is connected from a middle mouse button operation on views.
QAction * redoAction()
Creates an Action to redo the last action.
QList< QAction * > editMenuActions()
Get the list of actions that the Directory can provide for the edit menu.
void save(QXmlStreamWriter &stream, FileName newProjectRoot) const
Save the directory to an XML file.
BundleObservationView * addBundleObservationView(FileItemQsp fileItem)
Add the BundleObservationView to the window.
~Directory()
The Destructor.
void cleanupTemplateEditorWidgets(QObject *)
Removes pointers to deleted TemplateEditorWidget objects.
QList< ImageFileListWidget * > imageFileListViews()
Accessor for the list of ImageFileListWidgets currently available.
QList< QAction * > activeToolBarActions()
Get the list of actions that the Directory can provide for the active Tool Bar.
QPointer< WorkOrder > m_saveProjectWorkOrder
The Save Project WorkOrder.
Definition Directory.h:499
void modifyControlPoint(ControlPoint *controlPoint, QString serialNumber="")
Slot that is connected from a left mouse button operation on views.
QList< QAction * > m_projectMenuActions
List of project menu actions.
Definition Directory.h:510
QPointer< WorkOrder > m_importRegistrationTemplateWorkOrder
The Import Registration Template WorkOrder.
Definition Directory.h:504
QList< QAction * > m_editMenuActions
List of edit menu actions.
Definition Directory.h:511
QPointer< HistoryTreeWidget > m_historyTreeWidget
Pointer to the HistoryTreeWidget.
Definition Directory.h:466
QList< QPointer< TemplateEditorWidget > > m_templateEditorWidgets
List of TemplateEditorWidgets.
Definition Directory.h:485
QPointer< WorkOrder > m_importControlNetWorkOrder
The import ControlNetwork WorkOrder.
Definition Directory.h:495
void cleanupTargetInfoWidgets(QObject *)
Removes pointers to deleted TargetInfoWidget objects.
QList< QPointer< MatrixSceneWidget > > m_matrixViewWidgets
List of MatrixSceneWidgets.
Definition Directory.h:482
void initializeActions()
Initializes the actions that the Directory can provide to a main window.
QList< CnetEditorView * > cnetEditorViews()
Returns a list of all the control network views for this directory.
QPointer< WorkOrder > m_closeProjectWorkOrder
The Close Project WorkOrder.
Definition Directory.h:502
QPointer< ProjectItemModel > m_projectItemModel
Pointer to the ProjectItemModel.
Definition Directory.h:463
QList< QAction * > toolPadActions()
Get the list of actions that the Directory can provide for the Tool Pad.
void newActiveControl(bool newControl)
@description This slot is connected from the signal activeControlSet(bool) emitted from Project.
void cleanupMatrixViewWidgets(QObject *)
Removes pointers to deleted MatrixSceneWidget objects.
CubeDnView * addCubeDnView(QString objectName="")
Add the qview workspace to the window.
QPointer< WorkOrder > m_importImagesWorkOrder
The import images WorkOrder.
Definition Directory.h:496
QList< QAction * > permToolBarActions()
Get the list of actions that the Directory can provide for the permanent Tool Bar.
void clean()
Cleans directory of everything to do with the current project.
QList< QAction * > m_viewMenuActions
List of view menu actions.
Definition Directory.h:512
QStringList recentProjectsList()
Public accessor for the list of recent projects.
void setRecentProjectsList(QStringList recentProjects)
Add recent projects to the recent projects list.
ImageFileListWidget * addImageFileListView(QString objectName="")
Add an imageFileList widget to the window.
QList< CubeDnView * > cubeDnViews()
Accessor for the list of CubeDnViews currently available.
QPointer< JigsawRunWidget > m_jigsawRunWidget
Pointer to the JigsawRunWidget.
Definition Directory.h:469
TargetInfoWidget * addTargetInfoView(TargetBodyQsp target)
Add target body data view widget to the window.
void setHistoryContainer(QDockWidget *historyContainer)
Set up the history info in the history dockable widget.
QList< QAction * > m_activeToolBarActions
List of active ToolBar actions.
Definition Directory.h:517
QList< QPointer< ImageFileListWidget > > m_fileListWidgets
List of ImageFileListWidgets.
Definition Directory.h:476
QString editPointId()
Return the current control point id loaded in the ControlPointEditWidget.
QList< QAction * > m_permToolBarActions
List of perm ToolBar actions.
Definition Directory.h:516
static QList< QAction * > restructureActions(QList< QPair< QString, QList< QAction * > > >)
Reformat actionPairings to be user friendly for use in menus.
void showWarning(QString text)
Displays a Warning.
QList< TargetInfoWidget * > targetInfoViews()
Accessor for the list of TargetInfoWidgets currently available.
QAction * undoAction()
Creates an Action to undo the last action.
static bool actionTextLessThan(QAction *lhs, QAction *rhs)
This is for determining the ordering of the descriptive text of for the actions.
QList< QAction * > m_helpMenuActions
List of help menu actions.
Definition Directory.h:514
Project * project() const
Gets the Project for this directory.
QPointer< WorkOrder > m_saveProjectAsWorkOrder
The Save Project As WorkOrder.
Definition Directory.h:500
QList< QProgressBar * > progressBars()
Gets the ControlNetEditor associated with this the Directory.
void createControlPoint(double latitude, double longitude, Cube *cube=0, bool isGroundSource=false)
Slot that is connected from a right mouse button operation on views.
QList< QAction * > viewMenuActions()
Get the list of actions that the Directory can provide for the view menu.
void cleanupCubeDnViewWidgets(QObject *)
Removes pointers to deleted CubeDnView objects.
QList< QPointer< CnetEditorView > > m_cnetEditorViewWidgets
List of CnetEditorViews.
Definition Directory.h:474
QWidget * warningWidget()
Returns a pointer to the warning widget.
QMultiMap< Control *, CnetEditorView * > m_controlMap
Map to hold every view with an open Control.
Definition Directory.h:520
SensorInfoWidget * addSensorInfoView(GuiCameraQsp camera)
Add sensor data view widget to the window.
void cleanupFileListWidgets(QObject *)
Removes pointers to deleted ImageFileListWidget objects.
QStringList m_recentProjects
List of the names of recent projects.
Definition Directory.h:489
QPointer< WorkOrder > m_exportControlNetWorkOrder
The export ControlNetwork WorkOrder.
Definition Directory.h:493
void cleanupSensorInfoWidgets(QObject *)
Removes pointers to deleted SensorInfoWidget objects.
ProjectItemModel * model()
Gets the ProjectItemModel for this directory.
QPointer< WarningTreeWidget > m_warningTreeWidget
Pointer to the WarningTreeWidget.
Definition Directory.h:468
QList< QPointer< TargetInfoWidget > > m_targetInfoWidgets
List of TargetInfoWidgets.
Definition Directory.h:484
Footprint2DView * addFootprint2DView(QString objectName="")
Add the qmos view widget to the window.
QPointer< WorkOrder > m_runJigsawWorkOrder
The Run Jigsaw WorkOrder.
Definition Directory.h:506
QList< QPointer< SensorInfoWidget > > m_sensorInfoWidgets
List of SensorInfoWidgets.
Definition Directory.h:483
QPointer< Project > m_project
Pointer to the Project.
Definition Directory.h:467
QList< MatrixSceneWidget * > matrixViews()
Accessor for the list of MatrixSceneWidgets currently available.
QList< QAction * > projectMenuActions()
Get the list of actions that the Directory can provide for the project menu.
CnetEditorView * addCnetEditorView(Control *control, QString objectName="")
Add the widget for the cnet editor view to the window.
ControlPointEditView * controlPointEditView()
Gets the ControlPointEditWidget associated with the Directory.
QList< QPointer< Footprint2DView > > m_footprint2DViewWidgets
List of Footprint2DView objs.
Definition Directory.h:477
bool controlUsedInCnetEditorWidget(Control *control)
@description Return true if control is not currently being viewed in a CnetEditorWidget
QList< QPointer< WorkOrder > > m_workOrders
List of WorkOrders.
Definition Directory.h:487
QPointer< WorkOrder > m_openProjectWorkOrder
The Open Project WorkOrder.
Definition Directory.h:498
QList< QAction * > helpMenuActions()
Get the list of actions that the Directory can provide for the help menu.
QPointer< WorkOrder > m_renameProjectWorkOrder
The Rename Project WorkOrder.
Definition Directory.h:507
QString displayName() const
Returns the display name.
File name manipulation and expansion.
Definition FileName.h:100
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
Definition FileName.cpp:162
QString originalPath() const
Returns the path of the original file name.
Definition FileName.cpp:84
View for displaying footprints of images in a QMos like way.
MosaicSceneWidget * mosaicSceneWidget()
Accessor for the MosaicSceneWidget.
History Widget for ipce.
Isis exception class.
Definition IException.h:91
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition IException.h:146
A colored, grouped cube list.
void save(QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const
This method saves the FootprintColumns in the project and the settings associated with every column.
Internalizes a list of images and allows for operations on the entire list.
Definition ImageList.h:53
This dialog allows the user to select the bundle adjust parameters, run the bundle,...
This widget encompasses the entire matrixDisplay scene.
This opens a project that's saved on disk.
The main project for ipce.
Definition Project.h:287
QUndoStack * undoStack()
Returns the Projects stack of QUndoCommands.
Definition Project.cpp:1755
void addToProject(WorkOrder *)
This executes the WorkOrder and stores it in the project.
Definition Project.cpp:2659
QString projectRoot() const
Get the top-level folder of the project.
Definition Project.cpp:1727
Control * activeControl()
Return the Active Control (control network)
Definition Project.cpp:1964
static int maxRecentProjects()
Return max number of recent projects to be displayed.
Definition Project.h:396
Provides access to data stored in a Project through Qt's model-view framework.
A ProjectItemTreeView displays items from a ProjectItemProxyModel in a tree structure.
Change the project's GUI name.
Widget for displaying information about a sensor.
void setActiveControlNet(bool activeNet)
Sets if there is an active control net.
TableViewContent * content()
Returns the content of the table.
Widget for displaying information about a target.
Widget for displaying information about a target.
Warning Widget for ipce.
Provide Undo/redo abilities, serialization, and history for an operation.
Definition WorkOrder.h:311
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
This is free and unencumbered software released into the public domain.