Loading [MathJax]/jax/output/NativeMML/config.js
Isis 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
SaveProjectWorkOrder.h
Isis::SaveProjectWorkOrder
Saves a project to disk (File->Save Project...)
Definition: SaveProjectWorkOrder.h:47
ProjectItem.h
FileName.h
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Cube.h
Isis::Project::waitForImageReaderFinished
void waitForImageReaderFinished()
Locks program if another spot in code is still running and called this function.
Definition: Project.cpp:1732
Isis::WorkOrder::setupExecution
virtual bool setupExecution()
This sets up the state for the work order.
Definition: WorkOrder.cpp:1261
Isis::Project::addCamera
void addCamera(Camera *camera)
Adds a new camera to the project.
Definition: Project.cpp:2761
Isis::WorkOrder
Provide Undo/redo abilities, serialization, and history for an operation.
Definition: WorkOrder.h:311
Project.h
Isis::ImportImagesWorkOrder::clone
virtual ImportImagesWorkOrder * clone() const
Creates a clone of this work order.
Definition: ImportImagesWorkOrder.cpp:93
Isis::ImportImagesWorkOrder::~ImportImagesWorkOrder
~ImportImagesWorkOrder()
Destructor.
Definition: ImportImagesWorkOrder.cpp:78
Isis::Directory::model
ProjectItemModel * model()
Gets the ProjectItemModel for this directory.
Definition: Directory.cpp:1091
Isis::FileName::name
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
Definition: FileName.cpp:162
Isis::Project::addTarget
void addTarget(Target *target)
Adds a new target to the project.
Definition: Project.cpp:2730
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::IException::Unknown
@ Unknown
A type of error that cannot be classified as any of the other error types.
Definition: IException.h:118
Isis::WorkOrder::setInternalData
void setInternalData(QStringList data)
Sets the internal data for this WorkOrder.
Definition: WorkOrder.cpp:1318
Target.h
Isis::FileName::fileExists
bool fileExists() const
Returns true if the file exists; false otherwise.
Definition: FileName.cpp:449
Isis::Cube::copy
Cube * copy(FileName newFile, const CubeAttributeOutput &newFileAttributes)
Copies the cube to the new fileName.
Definition: Cube.cpp:276
Isis::ImageList::append
void append(Image *const &value)
Appends an image to the image list.
Definition: ImageList.cpp:153
Isis::TextFile
Provides access to sequential ASCII stream I/O.
Definition: TextFile.h:38
Isis::TextFile::GetLine
bool GetLine(QString &line, const bool skipComments=true)
Gets next line from file.
Definition: TextFile.cpp:411
Isis::CubeAttributeOutput
Manipulate and parse attributes of output cube filenames.
Definition: CubeAttribute.h:473
Isis::ImageList::deleteFromDisk
void deleteFromDisk(Project *project)
Delete all of the contained Images from disk.
Definition: ImageList.cpp:747
QSharedPointer
Definition: JigsawWorkOrder.h:28
Isis::Camera
Definition: Camera.h:236
Isis::WorkOrder::m_isSynchronous
bool m_isSynchronous
This is defaulted to true.
Definition: WorkOrder.h:530
Isis::ImportImagesWorkOrder::setupExecution
virtual bool setupExecution()
Sets up this work order before being executed.
Definition: ImportImagesWorkOrder.cpp:132
QStringList
Isis::ImportImagesWorkOrder::postUndoExecution
virtual void postUndoExecution()
Cleans up memory (images) after the undo execution occurs.
Definition: ImportImagesWorkOrder.cpp:262
Isis::IException::what
const char * what() const
Returns a string representation of this exception in its current state.
Definition: IException.cpp:375
Isis::Project
The main project for ipce.
Definition: Project.h:289
Isis::IException::append
void append(const IException &exceptionSource)
Appends the given exception (and its list of previous exceptions) to this exception's causational exc...
Definition: IException.cpp:409
Isis::Project::directory
Directory * directory() const
Returns the directory associated with this Project.
Definition: Project.cpp:1229
Isis::ImageList
Internalizes a list of images and allows for operations on the entire list.
Definition: ImageList.h:55
Isis::Spice::target
virtual Target * target() const
Returns a pointer to the target object.
Definition: Spice.cpp:1368
WorkOrder.h
Isis::Project::images
static QStringList images(QStringList)
Verify that the input fileNames are image files.
Definition: Project.cpp:894
Isis::FileName::expanded
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:196
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
TextFile.h
Isis::Image::closeCube
void closeCube()
Cleans up the Cube pointer.
Definition: Image.cpp:307
Isis::Project::warn
void warn(QString text, Data relevantData)
Definition: Project.cpp:2643
Isis::WorkOrder::project
Project * project() const
Returns the Project this WorkOrder is attached to.
Definition: WorkOrder.cpp:1300
ProjectItemModel.h
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::Image
This represents a cube in a project-based GUI interface.
Definition: Image.h:107
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::ProjectItemModel::findItemData
ProjectItem * findItemData(const QVariant &data, int role=Qt::UserRole+1)
Returns the first item found that contains the given data in the given role or a null pointer if no i...
Definition: ProjectItemModel.cpp:290
ImportImagesWorkOrder.h
Camera.h
Isis::WorkOrder::setProgressRange
void setProgressRange(int, int)
Sets the progress range of the WorkOrder.
Definition: WorkOrder.cpp:1358
Isis::Image::displayProperties
ImageDisplayProperties * displayProperties()
Get the display (GUI) properties (information) associated with this image.
Definition: Image.cpp:320
Isis::ImportImagesWorkOrder::isExecutable
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
Isis::Project::addImages
void addImages(QStringList imageFiles)
Read the given cube file names as Images and add them to the project.
Definition: Project.cpp:1032
Isis::Cube::camera
Camera * camera()
Return a camera associated with the cube.
Definition: Cube.cpp:1451
Isis::FileName::extension
QString extension() const
Returns the last extension of the file name.
Definition: FileName.cpp:178
IException.h
Isis::ImportImagesWorkOrder
Add cubes to a project.
Definition: ImportImagesWorkOrder.h:109
QThread
Isis::Cube::label
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition: Cube.cpp:1701
Isis::WorkOrder::WorkOrderFinished
@ WorkOrderFinished
This is used for work orders that will not undo or redo (See createsCleanState())
Definition: WorkOrder.h:331
Isis::Image::id
QString id() const
Get a unique, identifying string associated with this image.
Definition: Image.cpp:445
Isis::WorkOrder::setProgressValue
void setProgressValue(int)
Sets the current progress value for the WorkOrder.
Definition: WorkOrder.cpp:1368
Isis::WorkOrder::internalData
QStringList internalData() const
Gets the internal data for this WorkOrder.
Definition: WorkOrder.cpp:1377
Isis::WorkOrder::setModifiesDiskState
void setModifiesDiskState(bool changesProjectOnDisk)
Definition: WorkOrder.cpp:1674
QObject
Isis::FileName::original
QString original() const
Returns the full file name including the file path.
Definition: FileName.cpp:212
Isis::ImportImagesWorkOrder::ImportImagesWorkOrder
ImportImagesWorkOrder(Project *project)
Creates an asynchronous WorkOrder for importing images to the project.
Definition: ImportImagesWorkOrder.cpp:48
Isis::ImportImagesWorkOrder::postExecution
virtual void postExecution()
Associates the imported images to the project.
Definition: ImportImagesWorkOrder.cpp:308
Isis::Target
This class is used to create and store valid Isis targets.
Definition: Target.h:63
Isis::Project::setClean
void setClean(bool value)
Function to change the clean state of the project.
Definition: Project.cpp:1595
Isis::ProjectItemModel::removeItem
virtual void removeItem(ProjectItem *item)
Removes an item and its children from the model.
Definition: ProjectItemModel.cpp:315
Isis::Cube::relocateDnData
void relocateDnData(FileName dnDataFile)
Relocates the DN data for a cube to an external cube label file.
Definition: Cube.cpp:1366
CubeAttribute.h
Isis::Image::setId
void setId(QString id)
Override the automatically generated ID with the given ID.
Definition: Image.cpp:383
Isis::FileName::path
QString path() const
Returns the path of the file name.
Definition: FileName.cpp:103
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ImportImagesWorkOrder::undoExecution
virtual void undoExecution()
Undoes the work order's execute.
Definition: ImportImagesWorkOrder.cpp:240
Isis::Cube::reopen
void reopen(QString access="r")
This method will reopen an isis sube for reading or reading/writing.
Definition: Cube.cpp:774
Isis::Project::addImageFolder
QDir addImageFolder(QString prefix)
Create and return the name of a folder for placing images.
Definition: Project.cpp:1003
Isis::WorkOrder::m_status
WorkOrderStatus m_status
Definition: WorkOrder.h:539
Isis::ProjectItem
Represents an item of a ProjectItemModel in Qt's model-view framework.
Definition: ProjectItem.h:134
Isis::ImportImagesWorkOrder::execute
virtual void execute()
Executes the work order.
Definition: ImportImagesWorkOrder.cpp:282

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 USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 15:11:22