Isis 3 Programmer Reference
Directory.h
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.
288 ControlHealthMonitorView *addControlHealthMonitorView();
289 CnetEditorView *addCnetEditorView(Control *control, QString objectName = "");
290 CubeDnView *addCubeDnView(QString objectName = "");
291 Footprint2DView *addFootprint2DView(QString objectName = "");
292 JigsawRunWidget *addJigsawRunWidget();
297 ImageFileListWidget *addImageFileListView(QString objectName = "");
298 ControlPointEditView *addControlPointEditView();
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();
328 ControlHealthMonitorView *controlHealthMonitorView();
330 JigsawRunWidget *jigsawRunWidget();
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 load(XmlStackedHandlerReader *xmlReader);
391 void save(QXmlStreamWriter &stream, FileName newProjectRoot) const;
392
393 signals:
394 void directoryCleaned();
395 void newWarning();
396 void newDockAvailable(QMainWindow *newWidget);
397 void newWidgetAvailable(QWidget *newWidget);
398
399 void closeView(QWidget *widget);
400
401 void cnetModified();
402 void activeControlModified();
403
404 void redrawMeasures();
405
406 void cleanProject(bool);
407
408 public slots:
419 void cleanupJigsawRunWidget(QObject *);
420 //void imagesAddedToProject(ImageList *images);
422
423 // Slots in response to mouse clicks on CubeDnView (ControlNetTool) and
424 // Footprint2DView (MosaicControlNetTool)
425 void modifyControlPoint(ControlPoint *controlPoint, QString serialNumber = "");
426 void deleteControlPoint(ControlPoint *controlPoint);
427 void createControlPoint(double latitude, double longitude, Cube *cube = 0,
428 bool isGroundSource = false);
429
430
433
434 private slots:
435 void initiateRenameProjectWorkOrder(QString projectName);
436 void newActiveControl(bool newControl);
438
439 private:
446 public:
447 XmlHandler(Directory *directory);
448 ~XmlHandler();
449
450 virtual bool startElement(const QString &namespaceURI, const QString &localName,
451 const QString &qName, const QXmlAttributes &atts);
452
453 private:
454 Q_DISABLE_COPY(XmlHandler);
455
457 };
458
459 private:
460 Directory(const Directory &other);
461 Directory &operator=(const Directory &rhs);
462
471 template <typename WorkOrderType>
472 WorkOrderType *createWorkOrder() {
473 WorkOrderType *newWorkOrder = new WorkOrderType(m_project);
474 m_workOrders.append(newWorkOrder);
475 return newWorkOrder;
476 }
477
478
479 static QList<QAction *> restructureActions(QList< QPair< QString, QList<QAction *> > >);
480 static bool actionTextLessThan(QAction *lhs, QAction *rhs);
481
482 void initializeActions();
483
484 QPointer<ProjectItemModel> m_projectItemModel;
485
486
487 QPointer<HistoryTreeWidget> m_historyTreeWidget;
488 QPointer<Project> m_project;
489 QPointer<WarningTreeWidget> m_warningTreeWidget;
490 QPointer<JigsawRunWidget> m_jigsawRunWidget;
491
492
494 QList< QPointer<BundleObservationView> > m_bundleObservationViews;
495 QList< QPointer<CnetEditorView> > m_cnetEditorViewWidgets;
496 QList< QPointer<CubeDnView> > m_cubeDnViewWidgets;
497 QList< QPointer<ImageFileListWidget> > m_fileListWidgets;
498 QList< QPointer<Footprint2DView> > m_footprint2DViewWidgets;
499
500 QPointer<ControlHealthMonitorView> m_controlHealthMonitorView;
501 QPointer <ControlPointEditView> m_controlPointEditViewWidget;
502 //QPointer <ChipViewportsWidget> m_chipViewports;
503 QList< QPointer<MatrixSceneWidget> > m_matrixViewWidgets;
504 QList< QPointer<SensorInfoWidget> > m_sensorInfoWidgets;
505 QList< QPointer<TargetInfoWidget> > m_targetInfoWidgets;
506 QList< QPointer<TemplateEditorWidget> > m_templateEditorWidgets;
507
508 QList< QPointer<WorkOrder> > m_workOrders;
509
511
512 // We only need to store the work orders that go into menus uniquely... all work orders
513 // (including these) should be stored in m_workOrders
514 QPointer<WorkOrder> m_exportControlNetWorkOrder;
515 QPointer<WorkOrder> m_exportImagesWorkOrder;
516 QPointer<WorkOrder> m_importControlNetWorkOrder;
517 QPointer<WorkOrder> m_importImagesWorkOrder;
518 QPointer<WorkOrder> m_importShapesWorkOrder;
519 QPointer<WorkOrder> m_openProjectWorkOrder;
520 QPointer<WorkOrder> m_saveProjectWorkOrder;
521 QPointer<WorkOrder> m_saveProjectAsWorkOrder;
522 QPointer<WorkOrder> m_openRecentProjectWorkOrder;
523 QPointer<WorkOrder> m_closeProjectWorkOrder;
524 QPointer<WorkOrder> m_importMapTemplateWorkOrder;
526
527 QPointer<WorkOrder> m_runJigsawWorkOrder;
528 QPointer<WorkOrder> m_renameProjectWorkOrder;
529
530 QList<QAction *> m_fileMenuActions;
531 QList<QAction *> m_projectMenuActions;
532 QList<QAction *> m_editMenuActions;
533 QList<QAction *> m_viewMenuActions;
534 QList<QAction *> m_settingsMenuActions;
535 QList<QAction *> m_helpMenuActions;
536
537 QList<QAction *> m_permToolBarActions;
538 QList<QAction *> m_activeToolBarActions;
539 QList<QAction *> m_toolPadActions;
540
541 QMultiMap<Control*, CnetEditorView *> m_controlMap;
542
544
545 bool m_recentProjectsLoaded;
546 };
547}
548
549#endif // Directory_H
View for displaying BundleObservation CSV files.
Ipce view containing the CnetEditorWidget.
View for the Control Net Health Monitor.
This represents an ISIS control net in a project-based GUI interface.
Definition Control.h:66
View for editing a single ControlPoint.
A single control point.
View that displays cubes in a QView-like way.
Definition CubeDnView.h:97
IO Handler for Isis Cubes.
Definition Cube.h:168
Directory * m_directory
Pointer to a Directory which is set by the XmlHandler class.
Definition Directory.h:456
~XmlHandler()
The Destructor for Directory::XmlHandler.
XmlHandler(Directory *directory)
This function sets the Directory pointer for the Directory::XmlHandler class.
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
The XML reader invokes this method at the start of every element in the XML document.
QString m_editPointId
Current control point that is in the ControlPointEditWidget.
Definition Directory.h:543
void load(XmlStackedHandlerReader *xmlReader)
Loads the Directory from an XML file.
WorkOrderType * createWorkOrder()
Create a work order, append it to m_workOrders, and return it.
Definition Directory.h:472
ProjectItemTreeView * addProjectItemTreeView()
Adds a ProjectItemTreeView to the window.
QPointer< WorkOrder > m_importMapTemplateWorkOrder
The Import Map Template WorkOrder.
Definition Directory.h:524
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:518
QPointer< WorkOrder > m_exportImagesWorkOrder
The export images WorkOrder.
Definition Directory.h:515
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:496
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:534
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:530
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:539
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:520
void modifyControlPoint(ControlPoint *controlPoint, QString serialNumber="")
Slot that is connected from a left mouse button operation on views.
QList< QAction * > supportedActions(DataType data)
Returns a list of supported actions for a WorkOrder.
Definition Directory.h:345
QList< QAction * > m_projectMenuActions
List of project menu actions.
Definition Directory.h:531
void showWarning(QString text, Data data)
Shows warning text for a Widget.
Definition Directory.h:381
QPointer< WorkOrder > m_importRegistrationTemplateWorkOrder
The Import Registration Template WorkOrder.
Definition Directory.h:525
QList< QAction * > m_editMenuActions
List of edit menu actions.
Definition Directory.h:532
QPointer< HistoryTreeWidget > m_historyTreeWidget
Pointer to the HistoryTreeWidget.
Definition Directory.h:487
QList< QPointer< TemplateEditorWidget > > m_templateEditorWidgets
List of TemplateEditorWidgets.
Definition Directory.h:506
QPointer< WorkOrder > m_importControlNetWorkOrder
The import ControlNetwork WorkOrder.
Definition Directory.h:516
void cleanupTargetInfoWidgets(QObject *)
Removes pointers to deleted TargetInfoWidget objects.
QList< QPointer< MatrixSceneWidget > > m_matrixViewWidgets
List of MatrixSceneWidgets.
Definition Directory.h:503
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:523
QPointer< ProjectItemModel > m_projectItemModel
Pointer to the ProjectItemModel.
Definition Directory.h:484
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:517
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:533
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:490
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:538
QList< QPointer< ImageFileListWidget > > m_fileListWidgets
List of ImageFileListWidgets.
Definition Directory.h:497
QString editPointId()
Return the current control point id loaded in the ControlPointEditWidget.
QList< QAction * > m_permToolBarActions
List of perm ToolBar actions.
Definition Directory.h:537
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:535
Project * project() const
Gets the Project for this directory.
QPointer< WorkOrder > m_saveProjectAsWorkOrder
The Save Project As WorkOrder.
Definition Directory.h:521
QList< QProgressBar * > progressBars()
Gets the ControlNetEditor associated with this the Directory.
QPointer< WorkOrder > m_openRecentProjectWorkOrder
The Open Recent Project WorkOrder.
Definition Directory.h:522
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:495
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:541
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:510
QPointer< WorkOrder > m_exportControlNetWorkOrder
The export ControlNetwork WorkOrder.
Definition Directory.h:514
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:489
QList< QPointer< TargetInfoWidget > > m_targetInfoWidgets
List of TargetInfoWidgets.
Definition Directory.h:505
Footprint2DView * addFootprint2DView(QString objectName="")
Add the qmos view widget to the window.
QPointer< WorkOrder > m_runJigsawWorkOrder
The Run Jigsaw WorkOrder.
Definition Directory.h:527
QList< QPointer< SensorInfoWidget > > m_sensorInfoWidgets
List of SensorInfoWidgets.
Definition Directory.h:504
QPointer< Project > m_project
Pointer to the Project.
Definition Directory.h:488
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:498
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:508
QPointer< WorkOrder > m_openProjectWorkOrder
The Open Project WorkOrder.
Definition Directory.h:519
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:528
File name manipulation and expansion.
Definition FileName.h:100
View for displaying footprints of images in a QMos like way.
A colored, grouped cube list.
This dialog allows the user to select the bundle adjust parameters, run the bundle,...
This widget encompasses the entire matrixDisplay scene.
The main project for ipce.
Definition Project.h:289
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.
Widget for displaying information about a sensor.
Widget for displaying information about a target.
Widget for displaying information about a target.
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.
XML Handler that parses XMLs in a stack-oriented way.
Manage a stack of content handlers for reading XML files.
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.