Isis 3.0 Programmer Reference
Back | Home
Directory.h
Go to the documentation of this file.
1 #ifndef Directory_H
2 #define Directory_H
3 
26 #include <QObject>
27 #include <QPointer>
28 #include <QString>
29 #include <QtDebug>
30 
31 
32 #include "GuiCameraList.h"
33 #include "ImageList.h"
34 #include "MosaicSceneWidget.h"
35 #include "TargetBodyList.h"
36 #include "WorkOrder.h"
37 
38 class QAction;
39 class QDockWidget;
40 class QMenuBar;
41 class QProgressBar;
42 class QSplitter;
43 class QTabWidget;
44 
45 namespace Isis {
46  class ChipViewportsWidget;
47  class CnetEditorWidget;
48  class ControlNet;
49  class ControlPointEditView;
50  class CubeDnView;
51  class Footprint2DView;
52  class HistoryTreeWidget;
53  class ImageFileListWidget;
54  class MatrixSceneWidget;
55  class MosaicSceneWidget;
56  class Project;
57  class ProjectItem;
58  class ProjectItemModel;
59  class ProjectItemTreeView;
60  class SensorInfoWidget;
61  class TargetBody;
62  class TargetInfoWidget;
63  class WarningTreeWidget;
64  class WorkOrder;
65  class Workspace;
66 
106  class Directory : public QObject {
107  Q_OBJECT
108  public:
109  explicit Directory(QObject *parent = 0);
110  ~Directory();
111 
112  void populateMainMenu(QMenuBar *);
113  void setHistoryContainer(QDockWidget *historyContainer);
114  void setWarningContainer(QDockWidget *warningContainer);
115  void setRecentProjectsList(QStringList recentProjects);
117 
125  ControlPointEditView *addControlPointEditView();
126 
127 
129 
131 
132  Project *project() const;
133 
140 
144 
154  ChipViewportsWidget *controlPointChipViewports();
155 
156 
157 
163  template <typename DataType>
165  QList<QAction *> results;
166 
167  //QList< QPair< QString, QList<QAction *> > > actionPairings;
168 
169  //foreach (MosaicSceneWidget *footprint2DView, m_footprint2DViewWidgets) {
170  // actionPairings.append(
171  // qMakePair(footprint2DView->windowTitle(), footprint2DView->supportedActions(data)));
172  //}
173 
174  //results.append(restructureActions(actionPairings));
175 
176  //if (!results.isEmpty()) {
177  // results.append(NULL);
178  //}
179  //qDebug()<<"Directory.h::supportedActions #workorders = "<<m_workOrders.size();
180  foreach (WorkOrder *workOrder, m_workOrders) {
181  if (workOrder->isExecutable(data)) {
182  WorkOrder *clone = workOrder->clone();
183  clone->setData(data);
184  results.append(clone);
185  }
186  }
187 
188  return results;
189  }
190 
191  void showWarning(QString text);
192 
193 
199  template <typename Data>
200  void showWarning(QString text, Data data) {
201  //m_warningTreeWidget->showWarning(text, data);
202  }
203 
205 
206  QAction *redoAction();
207  QAction *undoAction();
208 
209  void load(XmlStackedHandlerReader *xmlReader);
210  void save(QXmlStreamWriter &stream, FileName newProjectRoot) const;
211 
212  signals:
213  void newWidgetAvailable(QWidget *newWidget);
214 
215  void controlPointAdded(QString newPointId);
216 
217  public slots:
220  void cleanupFileListWidgets();
226  //void imagesAddedToProject(ImageList *images);
228 
229  // Slots in response to mouse clicks on CubeDnView (IpceTool) and
230  // Footprint2DView (MosaicControlNetTool)
231  void modifyControlPoint(ControlPoint *controlPoint);
232  void deleteControlPoint(ControlPoint *controlPoint);
233  void createControlPoint(double latitude, double longitude, Cube *cube = 0,
234  bool isGroundSource = false);
235 
236  void updateRecentProjects(Project *project);
237 
238  private:
244  class XmlHandler : public XmlStackedHandler {
245  public:
246  XmlHandler(Directory *directory);
247  ~XmlHandler();
248 
249  virtual bool startElement(const QString &namespaceURI, const QString &localName,
250  const QString &qName, const QXmlAttributes &atts);
251 
252  private:
253  Q_DISABLE_COPY(XmlHandler);
254 
256  };
257 
258  private:
259  Directory(const Directory &other);
260  Directory &operator=(const Directory &rhs);
261 
270  template <typename WorkOrderType>
271  WorkOrderType *createWorkOrder() {
272  WorkOrderType *newWorkOrder = new WorkOrderType(m_project);
273  m_workOrders.append(newWorkOrder);
274  return newWorkOrder;
275  }
276 
278  static bool actionTextLessThan(QAction *lhs, QAction *rhs);
279 
280  void initializeActions();
281 
282  QPointer<ProjectItemModel> m_projectItemModel;
283 
284 
285  QPointer<HistoryTreeWidget> m_historyTreeWidget;
286  QPointer<Project> m_project;
287  QPointer<WarningTreeWidget> m_warningTreeWidget;
288 
293  QPointer <ControlPointEditView> m_controlPointEditViewWidget;
294  QPointer <ChipViewportsWidget> m_chipViewports;
298 
300 
302 
303  // We only need to store the work orders that go into menus uniquely... all work orders
304  // (including these) should be stored in m_workOrders
305  QPointer<WorkOrder> m_exportControlNetWorkOrder;
306  QPointer<WorkOrder> m_exportImagesWorkOrder;
307  QPointer<WorkOrder> m_importControlNetWorkOrder;
308  QPointer<WorkOrder> m_importImagesWorkOrder;
309  QPointer<WorkOrder> m_importShapesWorkOrder;
310  QPointer<WorkOrder> m_openProjectWorkOrder;
311  QPointer<WorkOrder> m_saveProjectWorkOrder;
312  QPointer<WorkOrder> m_saveProjectAsWorkOrder;
313  QPointer<WorkOrder> m_openRecentProjectWorkOrder;
314  QPointer<WorkOrder> m_closeProjectWorkOrder;
315 
316  QPointer<WorkOrder> m_runJigsawWorkOrder;
317  QPointer<WorkOrder> m_renameProjectWorkOrder;
318 
325 
329  };
330 }
331 
332 #endif // Directory_H
This represents an ISIS control net in a project-based GUI interface.
Definition: Control.h:57
~XmlHandler()
The Destructor for Directory::XmlHandler.
Definition: Directory.cpp:1163
QList< QAction * > editMenuActions()
Get the list of actions that the Directory can provide for the edit menu.
Definition: Directory.cpp:201
QList< MatrixSceneWidget * > matrixViews()
Accessor for the list of MatrixSceneWidgets currently available.
Definition: Directory.cpp:962
QList< QAction * > projectMenuActions()
Get the list of actions that the Directory can provide for the project menu.
Definition: Directory.cpp:192
QList< QAction * > toolPadActions()
Get the list of actions that the Directory can provide for the Tool Pad.
Definition: Directory.cpp:255
QPointer< WorkOrder > m_saveProjectWorkOrder
The Save Project WorkOrder.
Definition: Directory.h:311
Widget for displaying information about a sensor.
QList< QAction * > activeToolBarActions()
Get the list of actions that the Directory can provide for the active Tool Bar.
Definition: Directory.cpp:246
The main project for cnetsuite.
Definition: Project.h:105
QList< QPointer< SensorInfoWidget > > m_sensorInfoWidgets
List of SensorInfoWidgets.
Definition: Directory.h:296
void save(QXmlStreamWriter &stream, FileName newProjectRoot) const
Save the directory to an XML file.
Definition: Directory.cpp:1112
QList< QAction * > supportedActions(DataType data)
Returns a list of supported actions for a WorkOrder.
Definition: Directory.h:164
void cleanupTargetInfoWidgets()
Removes pointers to deleted TargetInfoWidget objects.
Definition: Directory.cpp:903
void cleanupFileListWidgets()
Reomoves pointers to deleted ImageFileListWidget objects.
Definition: Directory.cpp:861
File name manipulation and expansion.
Definition: FileName.h:111
QList< ImageFileListWidget * > imageFileListViews()
Accessor for the list of ImageFileListWidgets currently available.
Definition: Directory.cpp:1022
QStringList recentProjectsList()
Public accessor for the list of recent projects.
Definition: Directory.cpp:459
~Directory()
The Destructor.
Definition: Directory.cpp:167
View for displaying footprints of images in a QMos like way.
CnetEditorWidget * addCnetEditorView(Control *network)
Add the widget for the cnet editor view to the window.
Definition: Directory.cpp:469
QPointer< WorkOrder > m_importControlNetWorkOrder
The import ControlNetwork WorkOrder.
Definition: Directory.h:307
TargetInfoWidget * addTargetInfoView(TargetBodyQsp target)
Add target body data view widget to the window.
Definition: Directory.cpp:752
QList< QAction * > m_settingsMenuActions
List of menu settings actions.
Definition: Directory.h:323
MatrixSceneWidget * addMatrixView()
Add the matrix view widget to the window.
Definition: Directory.cpp:731
QList< QAction * > m_helpMenuActions
List of help menu actions.
Definition: Directory.h:324
void cleanupCnetEditorViewWidgets()
Removes pointers to deleted CnetEditorWidget objects.
Definition: Directory.cpp:845
void showWarning(QString text)
Displays a Warning.
Definition: Directory.cpp:1071
Directory * m_directory
Pointer to a Directory which is set by the XmlHandler class.
Definition: Directory.h:255
static bool actionTextLessThan(QAction *lhs, QAction *rhs)
This is for determining the ordering of the descriptive text of for the actions.
Definition: Directory.cpp:1362
QPointer< WorkOrder > m_runJigsawWorkOrder
The Run Jigsaw WorkOrder.
Definition: Directory.h:316
QList< QAction * > viewMenuActions()
Get the list of actions that the Directory can provide for the view menu.
Definition: Directory.cpp:210
QList< QPointer< CubeDnView > > m_cubeDnViewWidgets
List of CubeDnCiew obs.
Definition: Directory.h:290
QPointer< ProjectItemModel > m_projectItemModel
Pointer to the ProjectItemModel.
Definition: Directory.h:282
void populateMainMenu(QMenuBar *)
This method sets up the main menu at the top of the window (File, Settings, ...)
Definition: Directory.cpp:346
This widget encompasses the entire matrixDisplay scene.
ControlPointEditView * controlPointEditView()
Gets the ControlPointEditWidget associated with the Directory.
Definition: Directory.cpp:1036
void cleanupMatrixViewWidgets()
Removes pointers to deleted MatrixSceneWidget objects.
Definition: Directory.cpp:887
void setRecentProjectsList(QStringList recentProjects)
Add recent projects to the recent projects list.
Definition: Directory.cpp:450
QList< TargetInfoWidget * > targetInfoViews()
Accessor for the list of TargetInfoWidgets currently available.
Definition: Directory.cpp:992
CubeDnView * addCubeDnView()
Add the qview workspace to the window.
Definition: Directory.cpp:562
Project * project() const
Gets the Project for this directory.
Definition: Directory.cpp:923
void updateRecentProjects(Project *project)
Adds a new Project object to the list of recent projects if it has not already been added...
Definition: Directory.cpp:913
View for editing a single ControlPoint.
QList< QAction * > m_projectMenuActions
List of project menu actions.
Definition: Directory.h:320
QList< QAction * > permToolBarActions()
Get the list of actions that the Directory can provide for the permanent Tool Bar.
Definition: Directory.cpp:237
Provides access to data stored in a Project through Qt&#39;s model-view framework.
QAction * undoAction()
Creates an Action to undo the last action.
Definition: Directory.cpp:1089
QPointer< WorkOrder > m_openProjectWorkOrder
The Open Project WorkOrder.
Definition: Directory.h:310
QList< QAction * > m_fileMenuActions
List of file menu actions.
Definition: Directory.h:319
void load(XmlStackedHandlerReader *xmlReader)
Loads the Directory from an XML file.
Definition: Directory.cpp:1098
QList< Footprint2DView * > footprint2DViews()
Accessor for the list of Footprint2DViews currently available.
Definition: Directory.cpp:1007
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.
Definition: Directory.cpp:1182
virtual bool isExecutable(Context)
Re-implement this method if your work order utilizes controls for data in order to operate...
Definition: WorkOrder.cpp:179
QList< QAction * > settingsMenuActions()
Get the list of actions that the Directory can provide for the settings menu.
Definition: Directory.cpp:219
QPointer< WorkOrder > m_importShapesWorkOrder
The import shapes WorkOrder.
Definition: Directory.h:309
QList< QAction * > fileMenuActions()
Get the list of actions that the Directory can provide for the file menu.
Definition: Directory.cpp:183
Directory(QObject *parent=0)
The Constructor.
Definition: Directory.cpp:99
ProjectItemModel * model()
Gets the ProjectItemModel for this directory.
Definition: Directory.cpp:828
Parent class for anything that performs an action in Project.
Definition: WorkOrder.h:104
ProjectItemTreeView * addProjectItemTreeView()
Adds a ProjectItemTreeView to the window.
Definition: Directory.cpp:816
QList< QAction * > m_editMenuActions
List of edit menu actions.
Definition: Directory.h:321
QList< SensorInfoWidget * > sensorInfoViews()
Accessor for the list of SensorInfoWidgets currently available.
Definition: Directory.cpp:977
QList< QPointer< Footprint2DView > > m_footprint2DViewWidgets
List of Footprint2DView objs.
Definition: Directory.h:292
QAction * redoAction()
Creates an Action to redo the last action.
Definition: Directory.cpp:1080
QSharedPointer< TargetBody > TargetBodyQsp
Defines A smart pointer to a TargetBody obj.
Definition: TargetBody.h:224
QList< QProgressBar * > progressBars()
Gets the ControlNetEditor associated with this the Directory.
Definition: Directory.cpp:1061
WorkOrderType * createWorkOrder()
Create a work order, append it to m_workOrders, and return it.
Definition: Directory.h:271
QPointer< WorkOrder > m_saveProjectAsWorkOrder
The Save Project As WorkOrder.
Definition: Directory.h:312
A ProjectItemTreeView displays items from a ProjectItemProxyModel in a tree structure.
XML Handler that parses XMLs in a stack-oriented way.
void setWarningContainer(QDockWidget *warningContainer)
Set up the warning info in the warning dockable widget.
Definition: Directory.cpp:438
Widget for displaying information about a target.
QList< CubeDnView * > cubeDnViews()
Accessor for the list of CubeDnViews currently available.
Definition: Directory.cpp:947
A single control point.
Definition: ControlPoint.h:339
void setHistoryContainer(QDockWidget *historyContainer)
Set up the history info in the history dockable widget.
Definition: Directory.cpp:426
void cleanupCubeDnViewWidgets()
Removes pointers to deleted CubeDnView objects.
Definition: Directory.cpp:853
QList< QPointer< CnetEditorWidget > > m_cnetEditorViewWidgets
List of CnetEditorWidgets.
Definition: Directory.h:289
virtual void setData(Context)
Sets the context data for this WorkOrder.
Definition: WorkOrder.cpp:245
QPointer< WorkOrder > m_openRecentProjectWorkOrder
The Open Recent Project WorkOrder.
Definition: Directory.h:313
QPointer< Project > m_project
Pointer to the Project.
Definition: Directory.h:286
QList< QAction * > m_toolPadActions
List of ToolPad actions.
Definition: Directory.h:328
XmlHandler(Directory *directory)
This function sets the Directory pointer for the Directory::XmlHandler class.
Definition: Directory.cpp:1155
QWidget * warningWidget()
Returns a pointer to the warning widget.
Definition: Directory.cpp:837
QPointer< HistoryTreeWidget > m_historyTreeWidget
Pointer to the HistoryTreeWidget.
Definition: Directory.h:285
QSharedPointer< GuiCamera > GuiCameraQsp
GuiCameraQsp Represents a smart pointer to a GuiCamera object.
Definition: GuiCamera.h:188
QList< QAction * > m_permToolBarActions
List of perm ToolBar actions.
Definition: Directory.h:326
QPointer< WorkOrder > m_renameProjectWorkOrder
The Rename Project WorkOrder.
Definition: Directory.h:317
A colored, grouped cube list.
ImageFileListWidget * addImageFileListView()
Add an imageFileList widget to the window.
Definition: Directory.cpp:794
QList< QAction * > m_viewMenuActions
List of view menu actions.
Definition: Directory.h:322
View that displays cubes in a QView-like way.
Definition: CubeDnView.h:74
QPointer< WarningTreeWidget > m_warningTreeWidget
Pointer to the WarningTreeWidget.
Definition: Directory.h:287
void updateControlNetEditConnections()
Updates the SIGNAL/SLOT connections for the cotrol net editor.
Definition: Directory.cpp:1371
SensorInfoWidget * addSensorInfoView(GuiCameraQsp camera)
Add sensor data view widget to the window.
Definition: Directory.cpp:773
QList< QAction * > helpMenuActions()
Get the list of actions that the Directory can provide for the help menu.
Definition: Directory.cpp:228
Footprint2DView * addFootprint2DView()
Add the qmos view widget to the window.
Definition: Directory.cpp:599
QList< QPointer< MatrixSceneWidget > > m_matrixViewWidgets
List of MatrixSceneWidgets.
Definition: Directory.h:295
QPointer< WorkOrder > m_exportImagesWorkOrder
The export images WorkOrder.
Definition: Directory.h:306
QPointer< WorkOrder > m_exportControlNetWorkOrder
The export ControlNetwork WorkOrder.
Definition: Directory.h:305
QList< QPointer< TargetInfoWidget > > m_targetInfoWidgets
List of TargetInfoWidgets.
Definition: Directory.h:297
QPointer< WorkOrder > m_importImagesWorkOrder
The import images WorkOrder.
Definition: Directory.h:308
QList< QAction * > m_activeToolBarActions
List of active ToolBar actions.
Definition: Directory.h:327
Scrolled widget for display ChipViewports.
void showWarning(QString text, Data data)
Shows warning text for a Widget.
Definition: Directory.h:200
void cleanupFootprint2DViewWidgets()
Removes pointers to deleted Footprint2DView objects.
Definition: Directory.cpp:870
void cleanupControlPointEditViewWidget()
Delete the ControlPointEditWidget and set it&#39;s pointer to NULL.
Definition: Directory.cpp:878
void cleanupSensorInfoWidgets()
Removes pointers to deleted SensorInfoWidget objects.
Definition: Directory.cpp:895
QStringList m_recentProjects
List of the names of recent projects.
Definition: Directory.h:301
QList< QPointer< WorkOrder > > m_workOrders
List of WorkOrders.
Definition: Directory.h:299
his enables stack-based XML parsing of XML files.
QList< QPointer< ImageFileListWidget > > m_fileListWidgets
List of ImageFileListWidgets.
Definition: Directory.h:291
This widget provides full editing, filtering and viewing capabilities for the raw data in a control n...
void initializeActions()
Initializes the actions that the Directory can provide to a main window.
Definition: Directory.cpp:263
static QList< QAction * > restructureActions(QList< QPair< QString, QList< QAction * > > >)
Reformat actionPairings to be user friendly for use in menus.
Definition: Directory.cpp:1262
QPointer< WorkOrder > m_closeProjectWorkOrder
The Close Project WorkOrder.
Definition: Directory.h:314
IO Handler for Isis Cubes.
Definition: Cube.h:158
QList< CnetEditorWidget * > cnetEditorViews()
Returns a list of all the control network views for this directory.
Definition: Directory.cpp:932

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:17:35