Isis 3.0
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 
126 
127 
129 
131 
132  Project *project() const;
133 
140 
144 
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 
255  Directory *m_directory;
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 
277  static QList<QAction *> restructureActions(QList< QPair< QString, QList<QAction *> > >);
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 
289  QList< QPointer<CnetEditorWidget> > m_cnetEditorViewWidgets;
290  QList< QPointer<CubeDnView> > m_cubeDnViewWidgets;
291  QList< QPointer<ImageFileListWidget> > m_fileListWidgets;
292  QList< QPointer<Footprint2DView> > m_footprint2DViewWidgets;
293  QPointer <ControlPointEditView> m_controlPointEditViewWidget;
294  QPointer <ChipViewportsWidget> m_chipViewports;
295  QList< QPointer<MatrixSceneWidget> > m_matrixViewWidgets;
296  QList< QPointer<SensorInfoWidget> > m_sensorInfoWidgets;
297  QList< QPointer<TargetInfoWidget> > m_targetInfoWidgets;
298 
299  QList< QPointer<WorkOrder> > m_workOrders;
300 
301  QStringList m_recentProjects;
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 
319  QList<QAction *> m_fileMenuActions;
320  QList<QAction *> m_projectMenuActions;
321  QList<QAction *> m_editMenuActions;
322  QList<QAction *> m_viewMenuActions;
323  QList<QAction *> m_settingsMenuActions;
324  QList<QAction *> m_helpMenuActions;
325 
326  QList<QAction *> m_permToolBarActions;
327  QList<QAction *> m_activeToolBarActions;
328  QList<QAction *> m_toolPadActions;
329  };
330 }
331 
332 #endif // Directory_H
This represents an ISIS control net in a project-based GUI interface.
Definition: Control.h:57
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
Widget for displaying information about a sensor.
Definition: SensorInfoWidget.h:25
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
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
void createControlPoint(double latitude, double longitude, Cube *cube=0, bool isGroundSource=false)
Definition: Directory.cpp:1416
~Directory()
The Destructor.
Definition: Directory.cpp:167
View for displaying footprints of images in a QMos like way.
Definition: Footprint2DView.h:59
CnetEditorWidget * addCnetEditorView(Control *network)
Add the widget for the cnet editor view to the window.
Definition: Directory.cpp:469
TargetInfoWidget * addTargetInfoView(TargetBodyQsp target)
Add target body data view widget to the window.
Definition: Directory.cpp:752
MatrixSceneWidget * addMatrixView()
Add the matrix view widget to the window.
Definition: Directory.cpp:731
void cleanupCnetEditorViewWidgets()
Removes pointers to deleted CnetEditorWidget objects.
Definition: Directory.cpp:845
void showWarning(QString text)
Displays a Warning.
Definition: Directory.cpp:1071
QList< QAction * > viewMenuActions()
Get the list of actions that the Directory can provide for the view menu.
Definition: Directory.cpp:210
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.
Definition: MatrixSceneWidget.h:51
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
ControlPointEditView * addControlPointEditView()
Definition: Directory.cpp:654
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.
Definition: ControlPointEditView.h:48
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.
Definition: ProjectItemModel.h:94
QAction * undoAction()
Creates an Action to undo the last action.
Definition: Directory.cpp:1089
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 isExecutable(Context)
Re-implement this method if your work order utilizes controls for data in order to operate...
Definition: WorkOrder.cpp:179
void controlPointAdded(QString newPointId)
Definition: moc_Directory.cpp:229
QList< QAction * > settingsMenuActions()
Get the list of actions that the Directory can provide for the settings menu.
Definition: Directory.cpp:219
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< SensorInfoWidget * > sensorInfoViews()
Accessor for the list of SensorInfoWidgets currently available.
Definition: Directory.cpp:977
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
A ProjectItemTreeView displays items from a ProjectItemProxyModel in a tree structure.
Definition: ProjectItemTreeView.h:57
XML Handler that parses XMLs in a stack-oriented way.
Definition: XmlStackedHandler.h:47
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.
Definition: TargetInfoWidget.h:27
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
virtual void setData(Context)
Sets the context data for this WorkOrder.
Definition: WorkOrder.cpp:245
QWidget * warningWidget()
Returns a pointer to the warning widget.
Definition: Directory.cpp:837
QSharedPointer< GuiCamera > GuiCameraQsp
GuiCameraQsp Represents a smart pointer to a GuiCamera object.
Definition: GuiCamera.h:188
virtual WorkOrder * clone() const =0
A colored, grouped cube list.
Definition: ImageFileListWidget.h:50
ImageFileListWidget * addImageFileListView()
Add an imageFileList widget to the window.
Definition: Directory.cpp:794
View that displays cubes in a QView-like way.
Definition: CubeDnView.h:74
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
ChipViewportsWidget * controlPointChipViewports()
Definition: Directory.cpp:1042
Scrolled widget for display ChipViewports.
Definition: ChipViewportsWidget.h:34
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
Definition: CubeIoHandler.h:39
void modifyControlPoint(ControlPoint *controlPoint)
Definition: Directory.cpp:1398
Definition: Directory.h:106
his enables stack-based XML parsing of XML files.
Definition: XmlStackedHandlerReader.h:26
This widget provides full editing, filtering and viewing capabilities for the raw data in a control n...
Definition: CnetEditorWidget.h:46
void newWidgetAvailable(QWidget *newWidget)
Definition: moc_Directory.cpp:222
IO Handler for Isis Cubes.
Definition: Cube.h:158
void deleteControlPoint(ControlPoint *controlPoint)
Definition: Directory.cpp:1407
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:36