Isis 3 Developer Reference
ImportImagesWorkOrder.h
Go to the documentation of this file.
1 #ifndef ImportImagesWorkOrder_H
2 #define ImportImagesWorkOrder_H
3 
25 #include "WorkOrder.h"
26 
27 #include <functional>
28 
29 #include <QDir>
30 #include <QMutex>
31 
32 #include "IException.h"
33 
34 class QString;
35 
36 namespace Isis {
37  class Cube;
38  class FileName;
39 
110  Q_OBJECT
111  public:
115 
116  virtual ImportImagesWorkOrder *clone() const;
117 
118  virtual bool isExecutable(ProjectItem *item);
119  virtual bool setupExecution();
120 
121  virtual void execute();
122 
123  protected:
124  virtual void undoExecution();
125  virtual void postExecution();
126  virtual void postUndoExecution();
127 
128  private:
129  ImportImagesWorkOrder &operator=(const ImportImagesWorkOrder &rhs);
130 
139  class OriginalFileToProjectCubeFunctor :
140  public std::unary_function<const FileName &, Cube *> {
141  public:
142  OriginalFileToProjectCubeFunctor(QThread *guiThread,
143  QDir destinationFolder, bool copyDnData);
144  OriginalFileToProjectCubeFunctor(const OriginalFileToProjectCubeFunctor &other);
145  ~OriginalFileToProjectCubeFunctor();
146 
147  Cube *operator()(const FileName &original);
148 
149  IException errors() const;
150 
151  private:
153  OriginalFileToProjectCubeFunctor &operator=(const OriginalFileToProjectCubeFunctor &rhs);
154 
155  QDir m_destinationFolder;
156  bool m_copyDnData;
157  QThread *m_guiThread;
158 
159  QMutex m_errorsLock;
160  QSharedPointer<IException> m_errors;
161  QSharedPointer<int> m_numErrors;
162  };
163 
164  private:
165  void importConfirmedImages(QStringList confirmedImages, bool copyDnData);
166 
167  private:
168  ImageList *m_newImages;
169  ImageList *m_list;
170  QString m_warning;
171  };
172 }
173 #endif // ImportImagesWorkOrder_H
Internalizes a list of images and allows for operations on the entire list.
Definition: ImageList.h:55
The main project for ipce.
Definition: Project.h:289
File name manipulation and expansion.
Definition: FileName.h:116
Add cubes to a project.
Definition: ImportImagesWorkOrder.h:109
virtual void postUndoExecution()
Cleans up memory (images) after the undo execution occurs.
Definition: ImportImagesWorkOrder.cpp:262
virtual void postExecution()
Associates the imported images to the project.
Definition: ImportImagesWorkOrder.cpp:308
Provide Undo/redo abilities, serialization, and history for an operation.
Definition: WorkOrder.h:322
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Definition: JigsawWorkOrder.h:28
virtual bool isExecutable(ProjectItem *item)
This method returns true if the user clicked on a project tree node with the text "Images"...
Definition: ImportImagesWorkOrder.cpp:107
~ImportImagesWorkOrder()
Destructor.
Definition: ImportImagesWorkOrder.cpp:78
Represents an item of a ProjectItemModel in Qt&#39;s model-view framework.
Definition: ProjectItem.h:146
Isis exception class.
Definition: IException.h:107
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Project * project() const
Returns the Project this WorkOrder is attached to.
Definition: WorkOrder.cpp:1314
virtual bool setupExecution()
Sets up this work order before being executed.
Definition: ImportImagesWorkOrder.cpp:132
virtual void execute()
Executes the work order.
Definition: ImportImagesWorkOrder.cpp:282
ImportImagesWorkOrder(Project *project)
Creates an asynchronous WorkOrder for importing images to the project.
Definition: ImportImagesWorkOrder.cpp:48
virtual ImportImagesWorkOrder * clone() const
Creates a clone of this work order.
Definition: ImportImagesWorkOrder.cpp:93
IO Handler for Isis Cubes.
Definition: Cube.h:170
virtual void undoExecution()
Undoes the work order&#39;s execute.
Definition: ImportImagesWorkOrder.cpp:240