Isis Developer Reference
Directory.h
Go to the documentation of this file.
1#ifndef Directory_H
2#define Directory_H
3
10/* SPDX-License-Identifier: CC0-1.0 */
11
12#include <QMainWindow>
13#include <QMultiMap>
14#include <QObject>
15#include <QPointer>
16#include <QString>
17#include <QtDebug>
18
19
20#include "GuiCameraList.h"
21#include "ImageList.h"
22#include "MosaicSceneWidget.h"
23#include "TargetBodyList.h"
24#include "TemplateList.h"
25#include "WorkOrder.h"
26
27class QAction;
28class QDockWidget;
29class QMainWindow;
30class QMenuBar;
31class QProgressBar;
32class QSplitter;
33class QTabWidget;
34
35namespace Isis {
36 class AbstractProjectItemView;
37 class BundleObservation;
38 class BundleObservationView;
39 class ChipViewportsWidget;
40 class CnetEditorView;
41 class CnetEditorWidget;
42 class Control;
43 class ControlNet;
44 class ControlPointEditView;
45 class ControlHealthMonitorView;
46 class CubeDnView;
47 class FileItem;
48 class Footprint2DView;
49 class HistoryTreeWidget;
50 class ImageFileListWidget;
51 class JigsawRunWidget;
52 class MatrixSceneWidget;
53 class MosaicSceneWidget;
54 class Project;
55 class ProjectItem;
56 class ProjectItemModel;
57 class ProjectItemTreeView;
58 class SensorInfoWidget;
59 class TargetBody;
60 class TargetInfoWidget;
61 class TemplateEditorWidget;
62 class WarningTreeWidget;
63 class WorkOrder;
64 class Workspace;
65
271 class Directory : public QObject {
272 Q_OBJECT
273 public:
274 explicit Directory(QObject *parent = 0);
275 ~Directory();
276
277 void clean();
278 void setHistoryContainer(QDockWidget *historyContainer);
279 void setWarningContainer(QDockWidget *warningContainer);
280 void setRecentProjectsList(QStringList recentProjects);
282
283 // When adding a new view if the possibility exists for more than 1 of the view make sure
284 // to use a QUuid for the objectName so that save/restoreState will work for the view. Also,
285 // make sure the objectName is serialized to the project. For more info, see ::addCubeDnView,
286 // ::XmlHandler::startElement and CubeDnView::save.
289 CnetEditorView *addCnetEditorView(Control *control, QString objectName = "");
290 CubeDnView *addCubeDnView(QString objectName = "");
291 Footprint2DView *addFootprint2DView(QString objectName = "");
297 ImageFileListWidget *addImageFileListView(QString objectName = "");
299
300
302
304
305 Project *project() const;
306
307 QList<QAction *> fileMenuActions();
308 QList<QAction *> projectMenuActions();
309 QList<QAction *> editMenuActions();
310 QList<QAction *> viewMenuActions();
311 QList<QAction *> settingsMenuActions();
312 QList<QAction *> helpMenuActions();
313
314 QList<QAction *> permToolBarActions();
315 QList<QAction *> activeToolBarActions();
316 QList<QAction *> toolPadActions();
317
318 QList<BundleObservationView *> bundleObservationViews();
319 QList<CnetEditorView *> cnetEditorViews();
320 QList<CubeDnView *> cubeDnViews();
321 QList<Footprint2DView *> footprint2DViews();
322 QList<MatrixSceneWidget *> matrixViews();
323 QList<SensorInfoWidget *> sensorInfoViews();
324 QList<TargetInfoWidget *> targetInfoViews();
325 QList<TemplateEditorWidget *> templateEditorViews();
326 QList<ImageFileListWidget *> imageFileListViews();
327 QList<QProgressBar *> progressBars();
331// ChipViewportsWidget *controlPointChipViewports();
332
334
335 // Return the control point Id currently in the ControlPointEditWidget, if it exists
336 QString editPointId();
337
338
344 template <typename DataType>
345 QList<QAction *> supportedActions(DataType data) {
346 QList<QAction *> results;
347
348// QList< QPair< QString, QList<QAction *> > > actionPairings;
349
350 //foreach (MosaicSceneWidget *footprint2DView, m_footprint2DViewWidgets) {
351// actionPairings.append(
352 // qMakePair(footprint2DView->windowTitle(), footprint2DView->supportedActions(data)));
353// }
354
355// results.append(restructureActions(actionPairings));
356
357// if (!results.isEmpty()) {
358// results.append(NULL);
359// }
360// qDebug()<<"Directory.h::supportedActions #workorders = "<<m_workOrders.size();
361 foreach (WorkOrder *workOrder, m_workOrders) {
362 if (workOrder->isExecutable(data)) {
363 WorkOrder *clone = workOrder->clone();
364 clone->setData(data);
365 results.append(clone);
366 }
367 }
368
369 return results;
370 }
371
372 void showWarning(QString text);
373
374
380 template <typename Data>
381 void showWarning(QString text, Data data) {
382 //m_warningTreeWidget->showWarning(text, data);
383 }
384
386
389
390 void save(QXmlStreamWriter &stream, FileName newProjectRoot) const;
391
392 signals:
396 void newWidgetAvailable(QWidget *newWidget);
397
398 void closeView(QWidget *widget);
399
402
404
405 void cleanProject(bool);
406
407 public slots:
419 //void imagesAddedToProject(ImageList *images);
421
422 // Slots in response to mouse clicks on CubeDnView (ControlNetTool) and
423 // Footprint2DView (MosaicControlNetTool)
424 void modifyControlPoint(ControlPoint *controlPoint, QString serialNumber = "");
425 void deleteControlPoint(ControlPoint *controlPoint);
426 void createControlPoint(double latitude, double longitude, Cube *cube = 0,
427 bool isGroundSource = false);
428
429
432
433 private slots:
434 void initiateRenameProjectWorkOrder(QString projectName);
435 void newActiveControl(bool newControl);
436 void reloadActiveControlInCnetEditorView();
437
438 private:
439 Directory(const Directory &other);
440 Directory &operator=(const Directory &rhs);
441
450 template <typename WorkOrderType>
451 WorkOrderType *createWorkOrder() {
452 WorkOrderType *newWorkOrder = new WorkOrderType(m_project);
453 m_workOrders.append(newWorkOrder);
454 return newWorkOrder;
455 }
456
457
458 static QList<QAction *> restructureActions(QList< QPair< QString, QList<QAction *> > >);
459 static bool actionTextLessThan(QAction *lhs, QAction *rhs);
460
461 void initializeActions();
462
463 QPointer<ProjectItemModel> m_projectItemModel;
464
465
466 QPointer<HistoryTreeWidget> m_historyTreeWidget;
467 QPointer<Project> m_project;
468 QPointer<WarningTreeWidget> m_warningTreeWidget;
469 QPointer<JigsawRunWidget> m_jigsawRunWidget;
470
471
473 QList< QPointer<BundleObservationView> > m_bundleObservationViews;
474 QList< QPointer<CnetEditorView> > m_cnetEditorViewWidgets;
475 QList< QPointer<CubeDnView> > m_cubeDnViewWidgets;
476 QList< QPointer<ImageFileListWidget> > m_fileListWidgets;
477 QList< QPointer<Footprint2DView> > m_footprint2DViewWidgets;
478
479 QPointer<ControlHealthMonitorView> m_controlHealthMonitorView;
480 QPointer <ControlPointEditView> m_controlPointEditViewWidget;
481 //QPointer <ChipViewportsWidget> m_chipViewports;
482 QList< QPointer<MatrixSceneWidget> > m_matrixViewWidgets;
483 QList< QPointer<SensorInfoWidget> > m_sensorInfoWidgets;
484 QList< QPointer<TargetInfoWidget> > m_targetInfoWidgets;
485 QList< QPointer<TemplateEditorWidget> > m_templateEditorWidgets;
486
487 QList< QPointer<WorkOrder> > m_workOrders;
488
489 QStringList m_recentProjects;
490
491 // We only need to store the work orders that go into menus uniquely... all work orders
492 // (including these) should be stored in m_workOrders
493 QPointer<WorkOrder> m_exportControlNetWorkOrder;
494 QPointer<WorkOrder> m_exportImagesWorkOrder;
495 QPointer<WorkOrder> m_importControlNetWorkOrder;
496 QPointer<WorkOrder> m_importImagesWorkOrder;
497 QPointer<WorkOrder> m_importShapesWorkOrder;
498 QPointer<WorkOrder> m_openProjectWorkOrder;
499 QPointer<WorkOrder> m_saveProjectWorkOrder;
500 QPointer<WorkOrder> m_saveProjectAsWorkOrder;
501 QPointer<WorkOrder> m_openRecentProjectWorkOrder;
502 QPointer<WorkOrder> m_closeProjectWorkOrder;
503 QPointer<WorkOrder> m_importMapTemplateWorkOrder;
504 QPointer<WorkOrder> m_importRegistrationTemplateWorkOrder;
505
506 QPointer<WorkOrder> m_runJigsawWorkOrder;
507 QPointer<WorkOrder> m_renameProjectWorkOrder;
508
509 QList<QAction *> m_fileMenuActions;
510 QList<QAction *> m_projectMenuActions;
511 QList<QAction *> m_editMenuActions;
512 QList<QAction *> m_viewMenuActions;
513 QList<QAction *> m_settingsMenuActions;
514 QList<QAction *> m_helpMenuActions;
515
516 QList<QAction *> m_permToolBarActions;
517 QList<QAction *> m_activeToolBarActions;
518 QList<QAction *> m_toolPadActions;
519
520 QMultiMap<Control*, CnetEditorView *> m_controlMap;
521
522 QString m_editPointId;
523
524 bool m_recentProjectsLoaded;
525 };
526}
527
528#endif // Directory_H
View for displaying BundleObservation CSV files.
Definition BundleObservationView.h:44
Ipce view containing the CnetEditorWidget.
Definition CnetEditorView.h:63
View for the Control Net Health Monitor.
Definition ControlHealthMonitorView.h:43
This represents an ISIS control net in a project-based GUI interface.
Definition Control.h:65
View for editing a single ControlPoint.
Definition ControlPointEditView.h:53
A single control point.
Definition ControlPoint.h:356
View that displays cubes in a QView-like way.
Definition CubeDnView.h:95
IO Handler for Isis Cubes.
Definition Cube.h:168
Definition Directory.h:271
JigsawRunWidget * addJigsawRunWidget()
Definition Directory.cpp:980
ProjectItemTreeView * addProjectItemTreeView()
Adds a ProjectItemTreeView to the window.
Definition Directory.cpp:1051
ControlHealthMonitorView * controlHealthMonitorView()
Definition Directory.cpp:807
void cleanupControlPointEditViewWidget(QObject *)
Delete the ControlPointEditWidget and set it's pointer to NULL.
Definition Directory.cpp:1217
QList< TemplateEditorWidget * > templateEditorViews()
Accessor for the list of TemplateEditorWidgets currently available.
Definition Directory.cpp:1393
QList< SensorInfoWidget * > sensorInfoViews()
Accessor for the list of SensorInfoWidgets currently available.
Definition Directory.cpp:1363
void updateRecentProjects()
Loads and displays a list of recently opened projects in the file menu.
Definition Directory.cpp:316
void cleanupFootprint2DViewWidgets(QObject *)
Removes pointers to deleted Footprint2DView objects.
Definition Directory.cpp:1203
void newDockAvailable(QMainWindow *newWidget)
void cleanupCnetEditorViewWidgets(QObject *)
Removes pointers to deleted CnetEditorWidget objects.
Definition Directory.cpp:1133
QList< QAction * > settingsMenuActions()
Get the list of actions that the Directory can provide for the settings menu.
Definition Directory.cpp:240
void setWarningContainer(QDockWidget *warningContainer)
Set up the warning info in the warning dockable widget.
Definition Directory.cpp:521
void cleanupBundleObservationViews(QObject *)
Removes pointers to deleted BundleObservationView objects.
Definition Directory.cpp:1106
QList< Footprint2DView * > footprint2DViews()
Accessor for the list of Footprint2DViews currently available.
Definition Directory.cpp:1408
MatrixSceneWidget * addMatrixView()
Add the matrix view widget to the window.
Definition Directory.cpp:922
void updateControlNetEditConnections()
Updates the SIGNAL/SLOT connections for the cotrol net editor.
Definition Directory.cpp:1732
TemplateEditorWidget * addTemplateEditorView(Template *currentTemplate)
Add template editor view widget to the window.
Definition Directory.cpp:964
QList< QAction * > fileMenuActions()
Get the list of actions that the Directory can provide for the file menu.
Definition Directory.cpp:204
Directory(QObject *parent=0)
The Constructor.
Definition Directory.cpp:103
void deleteControlPoint(ControlPoint *controlPoint)
Slot that is connected from a middle mouse button operation on views.
Definition Directory.cpp:1788
ControlPointEditView * addControlPointEditView()
Definition Directory.cpp:835
QAction * redoAction()
Creates an Action to redo the last action.
Definition Directory.cpp:1489
QList< QAction * > editMenuActions()
Get the list of actions that the Directory can provide for the edit menu.
Definition Directory.cpp:222
void save(QXmlStreamWriter &stream, FileName newProjectRoot) const
Save the directory to an XML file.
Definition Directory.cpp:1512
BundleObservationView * addBundleObservationView(FileItemQsp fileItem)
Add the BundleObservationView to the window.
Definition Directory.cpp:600
~Directory()
The Destructor.
Definition Directory.cpp:189
void cleanupTemplateEditorWidgets(QObject *)
Removes pointers to deleted TemplateEditorWidget objects.
Definition Directory.cpp:1274
QList< ImageFileListWidget * > imageFileListViews()
Accessor for the list of ImageFileListWidgets currently available.
Definition Directory.cpp:1423
QList< QAction * > activeToolBarActions()
Get the list of actions that the Directory can provide for the active Tool Bar.
Definition Directory.cpp:267
void redrawMeasures()
void modifyControlPoint(ControlPoint *controlPoint, QString serialNumber="")
Slot that is connected from a left mouse button operation on views.
Definition Directory.cpp:1766
QList< QAction * > supportedActions(DataType data)
Returns a list of supported actions for a WorkOrder.
Definition Directory.h:345
void showWarning(QString text, Data data)
Shows warning text for a Widget.
Definition Directory.h:381
void cleanupJigsawRunWidget(QObject *)
Definition Directory.cpp:1286
void cleanupTargetInfoWidgets(QObject *)
Removes pointers to deleted TargetInfoWidget objects.
Definition Directory.cpp:1260
QList< CnetEditorView * > cnetEditorViews()
Returns a list of all the control network views for this directory.
Definition Directory.cpp:1318
void closeView(QWidget *widget)
QList< QAction * > toolPadActions()
Get the list of actions that the Directory can provide for the Tool Pad.
Definition Directory.cpp:276
void cleanupMatrixViewWidgets(QObject *)
Removes pointers to deleted MatrixSceneWidget objects.
Definition Directory.cpp:1232
CubeDnView * addCubeDnView(QString objectName="")
Add the qview workspace to the window.
Definition Directory.cpp:704
QList< QAction * > permToolBarActions()
Get the list of actions that the Directory can provide for the permanent Tool Bar.
Definition Directory.cpp:258
void clean()
Cleans directory of everything to do with the current project.
Definition Directory.cpp:287
JigsawRunWidget * jigsawRunWidget()
Definition Directory.cpp:1443
QStringList recentProjectsList()
Public accessor for the list of recent projects.
Definition Directory.cpp:591
void setRecentProjectsList(QStringList recentProjects)
Add recent projects to the recent projects list.
Definition Directory.cpp:533
ImageFileListWidget * addImageFileListView(QString objectName="")
Add an imageFileList widget to the window.
Definition Directory.cpp:1024
QList< CubeDnView * > cubeDnViews()
Accessor for the list of CubeDnViews currently available.
Definition Directory.cpp:1333
TargetInfoWidget * addTargetInfoView(TargetBodyQsp target)
Add target body data view widget to the window.
Definition Directory.cpp:943
void setHistoryContainer(QDockWidget *historyContainer)
Set up the history info in the history dockable widget.
Definition Directory.cpp:509
QString editPointId()
Return the current control point id loaded in the ControlPointEditWidget.
Definition Directory.cpp:1839
ControlHealthMonitorView * addControlHealthMonitorView()
Definition Directory.cpp:812
void showWarning(QString text)
Displays a Warning.
Definition Directory.cpp:1479
QList< TargetInfoWidget * > targetInfoViews()
Accessor for the list of TargetInfoWidgets currently available.
Definition Directory.cpp:1378
QAction * undoAction()
Creates an Action to undo the last action.
Definition Directory.cpp:1498
Project * project() const
Gets the Project for this directory.
Definition Directory.cpp:1309
QList< QProgressBar * > progressBars()
Gets the ControlNetEditor associated with this the Directory.
Definition Directory.cpp:1469
void createControlPoint(double latitude, double longitude, Cube *cube=0, bool isGroundSource=false)
Slot that is connected from a right mouse button operation on views.
Definition Directory.cpp:1819
QList< QAction * > viewMenuActions()
Get the list of actions that the Directory can provide for the view menu.
Definition Directory.cpp:231
void cleanupCubeDnViewWidgets(QObject *)
Removes pointers to deleted CubeDnView objects.
Definition Directory.cpp:1175
QWidget * warningWidget()
Returns a pointer to the warning widget.
Definition Directory.cpp:1098
SensorInfoWidget * addSensorInfoView(GuiCameraQsp camera)
Add sensor data view widget to the window.
Definition Directory.cpp:1002
void cleanupFileListWidgets(QObject *)
Removes pointers to deleted ImageFileListWidget objects.
Definition Directory.cpp:1189
void cleanupSensorInfoWidgets(QObject *)
Removes pointers to deleted SensorInfoWidget objects.
Definition Directory.cpp:1246
void directoryCleaned()
ProjectItemModel * model()
Gets the ProjectItemModel for this directory.
Definition Directory.cpp:1089
QList< BundleObservationView * > bundleObservationViews()
Footprint2DView * addFootprint2DView(QString objectName="")
Add the qmos view widget to the window.
Definition Directory.cpp:755
QList< MatrixSceneWidget * > matrixViews()
Accessor for the list of MatrixSceneWidgets currently available.
Definition Directory.cpp:1348
QList< QAction * > projectMenuActions()
Get the list of actions that the Directory can provide for the project menu.
Definition Directory.cpp:213
void activeControlModified()
CnetEditorView * addCnetEditorView(Control *control, QString objectName="")
Add the widget for the cnet editor view to the window.
Definition Directory.cpp:654
ControlPointEditView * controlPointEditView()
Gets the ControlPointEditWidget associated with the Directory.
Definition Directory.cpp:1437
bool controlUsedInCnetEditorWidget(Control *control)
@description Return true if control is not currently being viewed in a CnetEditorWidget
Definition Directory.cpp:1159
void cleanProject(bool)
QList< QAction * > helpMenuActions()
Get the list of actions that the Directory can provide for the help menu.
Definition Directory.cpp:249
void newWidgetAvailable(QWidget *newWidget)
File name manipulation and expansion.
Definition FileName.h:100
View for displaying footprints of images in a QMos like way.
Definition Footprint2DView.h:100
A colored, grouped cube list.
Definition ImageFileListWidget.h:64
This dialog allows the user to select the bundle adjust parameters, run the bundle,...
Definition JigsawRunWidget.h:109
This widget encompasses the entire matrixDisplay scene.
Definition MatrixSceneWidget.h:49
The main project for ipce.
Definition Project.h:287
Provides access to data stored in a Project through Qt's model-view framework.
Definition ProjectItemModel.h:132
A ProjectItemTreeView displays items from a ProjectItemProxyModel in a tree structure.
Definition ProjectItemTreeView.h:56
Widget for displaying information about a sensor.
Definition SensorInfoWidget.h:30
Widget for displaying information about a target.
Definition TargetInfoWidget.h:35
Widget for displaying information about a target.
Definition TemplateEditorWidget.h:35
Definition Template.h:30
Provide Undo/redo abilities, serialization, and history for an operation.
Definition WorkOrder.h:311
virtual void setData(Context)
Sets the context data for this WorkOrder.
Definition WorkOrder.cpp:245
virtual WorkOrder * clone() const =0
This is free and unencumbered software released into the public domain.
Definition BoxcarCachingAlgorithm.h:13
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.
Definition CubeIoHandler.h:23