Isis 3 Programmer Reference
ImportShapesWorkOrder.h
Go to the documentation of this file.
1 #ifndef ImportShapesWorkOrder_H
2 #define ImportShapesWorkOrder_H
3 
23 #include "WorkOrder.h"
24 
25 #include <functional>
26 
27 #include <QDir>
28 #include <QMutex>
29 
30 #include "IException.h"
31 
32 class QString;
33 
34 namespace Isis {
35  class Cube;
36  class FileName;
37  class ShapeList;
38 
67  Q_OBJECT
68  public:
72 
73  virtual ImportShapesWorkOrder *clone() const;
74 
75  virtual bool isExecutable(ProjectItem *item);
76  bool setupExecution();
77 
78  void execute();
79  void postExecution();
80  void undoExecution();
81  void postUndoExecution();
82 
83  private:
84  ImportShapesWorkOrder &operator=(const ImportShapesWorkOrder &rhs);
85 
96  public std::unary_function<const FileName &, Cube *> {
97  public:
99  QDir destinationFolder, bool copyDnData);
102 
103  Cube *operator()(const FileName &original);
104 
105  IException errors() const;
106 
107  private:
110 
114 
115  QMutex m_errorsLock;
118  };
119 
120  private:
121  void importConfirmedShapes(QStringList confirmedShapes, bool copyDnData);
122 
123  private:
126  QString m_warning;
127  };
128 }
129 #endif // ImportShapesWorkOrder_H
Isis::ImportShapesWorkOrder::undoExecution
void undoExecution()
delete the imported shapes from the disk.
Definition: ImportShapesWorkOrder.cpp:191
Isis::ImportShapesWorkOrder::ImportShapesWorkOrder
ImportShapesWorkOrder(Project *project)
Creates a work order to import a shape model.
Definition: ImportShapesWorkOrder.cpp:45
Isis::ImportShapesWorkOrder::m_list
ShapeList * m_list
List of shapes this workorder added to the project.
Definition: ImportShapesWorkOrder.h:125
Isis::ImportShapesWorkOrder::OriginalFileToProjectCubeFunctor::m_destinationFolder
QDir m_destinationFolder
Directory where the DN data is going to be stored.
Definition: ImportShapesWorkOrder.h:111
Isis::WorkOrder
Provide Undo/redo abilities, serialization, and history for an operation.
Definition: WorkOrder.h:311
Isis::ImportShapesWorkOrder::m_warning
QString m_warning
QString of warning text.
Definition: ImportShapesWorkOrder.h:126
Isis::ImportShapesWorkOrder::postExecution
void postExecution()
Add the imported shapes into the project.
Definition: ImportShapesWorkOrder.cpp:231
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::ImportShapesWorkOrder::OriginalFileToProjectCubeFunctor::m_numErrors
QSharedPointer< int > m_numErrors
Number of errors that have occured.
Definition: ImportShapesWorkOrder.h:117
Isis::ImportShapesWorkOrder::m_newShapes
ShapeList * m_newShapes
List of shapes.
Definition: ImportShapesWorkOrder.h:124
QSharedPointer
Definition: JigsawWorkOrder.h:28
Isis::ImportShapesWorkOrder::OriginalFileToProjectCubeFunctor::OriginalFileToProjectCubeFunctor
OriginalFileToProjectCubeFunctor(QThread *guiThread, QDir destinationFolder, bool copyDnData)
OriginalFileToProjectFunctor constructor.
Definition: ImportShapesWorkOrder.cpp:256
QStringList
Isis::ImportShapesWorkOrder::isExecutable
virtual bool isExecutable(ProjectItem *item)
This method returns true if the user clicked on a project tree node with the text "Shapes".
Definition: ImportShapesWorkOrder.cpp:102
Isis::Project
The main project for ipce.
Definition: Project.h:289
Isis::ImportShapesWorkOrder::OriginalFileToProjectCubeFunctor::m_errors
QSharedPointer< IException > m_errors
Shared pointers for errors.
Definition: ImportShapesWorkOrder.h:116
Isis::ImportShapesWorkOrder::postUndoExecution
void postUndoExecution()
delete the imported shapes from the project.
Definition: ImportShapesWorkOrder.cpp:206
Isis::ImportShapesWorkOrder::OriginalFileToProjectCubeFunctor::operator()
Cube * operator()(const FileName &original)
Creates ecubs and copies the DN data of the cubes, if m_copyDnData is true.
Definition: ImportShapesWorkOrder.cpp:296
Isis::ImportShapesWorkOrder::OriginalFileToProjectCubeFunctor::m_errorsLock
QMutex m_errorsLock
Mutex lock for errors.
Definition: ImportShapesWorkOrder.h:115
Isis::ImportShapesWorkOrder::OriginalFileToProjectCubeFunctor::m_copyDnData
bool m_copyDnData
Stores if the user wants to copy the DN data or not.
Definition: ImportShapesWorkOrder.h:112
Isis::ImportShapesWorkOrder
Add shape model cubes to a project.
Definition: ImportShapesWorkOrder.h:66
Isis::ImportShapesWorkOrder::OriginalFileToProjectCubeFunctor::m_guiThread
QThread * m_guiThread
The GUI thread.
Definition: ImportShapesWorkOrder.h:113
Isis::ImportShapesWorkOrder::OriginalFileToProjectCubeFunctor
This copies the given shape model cube(s) into the project.
Definition: ImportShapesWorkOrder.h:96
Isis::WorkOrder::project
Project * project() const
Returns the Project this WorkOrder is attached to.
Definition: WorkOrder.cpp:1300
Isis::ShapeList
Internalizes a list of shapes and allows for operations on the entire list.
Definition: ShapeList.h:33
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::ImportShapesWorkOrder::importConfirmedShapes
void importConfirmedShapes(QStringList confirmedShapes, bool copyDnData)
Creates a project shape folder and copies the shape cubes into it.
Definition: ImportShapesWorkOrder.cpp:382
Isis::ImportShapesWorkOrder::~ImportShapesWorkOrder
~ImportShapesWorkOrder()
Destructor.
Definition: ImportShapesWorkOrder.cpp:74
QThread
Isis::ImportShapesWorkOrder::OriginalFileToProjectCubeFunctor::errors
IException errors() const
Returns the errors from importing.
Definition: ImportShapesWorkOrder.cpp:350
Isis::ImportShapesWorkOrder::setupExecution
bool setupExecution()
Prompt the user for shape files to import and whether to copy DN data in to project.
Definition: ImportShapesWorkOrder.cpp:126
Isis::ImportShapesWorkOrder::execute
void execute()
Creates a project shape folder and copies the shape cubes into it.
Definition: ImportShapesWorkOrder.cpp:219
Isis::ImportShapesWorkOrder::OriginalFileToProjectCubeFunctor::~OriginalFileToProjectCubeFunctor
~OriginalFileToProjectCubeFunctor()
Destructor.
Definition: ImportShapesWorkOrder.cpp:282
Isis::ImportShapesWorkOrder::clone
virtual ImportShapesWorkOrder * clone() const
This method clones the current ImportShapesWorkOrder and returns it.
Definition: ImportShapesWorkOrder.cpp:88
Isis::ImportShapesWorkOrder::OriginalFileToProjectCubeFunctor::operator=
OriginalFileToProjectCubeFunctor & operator=(const OriginalFileToProjectCubeFunctor &rhs)
Not implemented.
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ProjectItem
Represents an item of a ProjectItemModel in Qt's model-view framework.
Definition: ProjectItem.h:134