File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
 |
Isis 3 Programmer Reference
|
Go to the documentation of this file.
23 #include "ExportImagesWorkOrder.h"
26 #include <QFileDialog>
28 #include <QInputDialog>
29 #include <QtConcurrentMap>
32 #include "CubeAttribute.h"
34 #include "ImageList.h"
36 #include "IException.h"
42 ExportImagesWorkOrder::ExportImagesWorkOrder(Project *project) :
49 QAction::setText(tr(
"Export I&mages..."));
53 ExportImagesWorkOrder::ExportImagesWorkOrder(
const ExportImagesWorkOrder &other) :
58 ExportImagesWorkOrder::~ExportImagesWorkOrder() {
63 ExportImagesWorkOrder *ExportImagesWorkOrder::clone()
const {
64 return new ExportImagesWorkOrder(*
this);
78 return (!images->isEmpty());
100 imageListNames.append(list->
name());
103 qSort(imageListNames);
105 QString choice = QInputDialog::getItem(NULL, tr(
"Select Image List"),
106 tr(
"Please choose a list of images to export."), imageListNames, 0,
false, &success);
110 QUndoCommand::setText(tr(
"Export image list [%1]").arg(choice));
113 QUndoCommand::setText(tr(
"Export [%1] images").arg(
imageList()->count()));
116 QString destination = QFileDialog::getExistingDirectory(NULL, tr(
"Export Images"),
".");
118 if (destination.isEmpty()) {
137 if (list->isEmpty()) {
145 QFuture<void *> future = QtConcurrent::mapped(*list, functor);
149 QThreadPool::globalInstance()->releaseThread();
150 for (
int i = 0; i < list->count(); i++) {
157 QThreadPool::globalInstance()->reserveThread();
168 if (!m_warning.isEmpty()) {
182 QString destination) : m_errors(new
IException()), m_numErrors(new int(0)) {
184 m_destination = destination;
196 m_numErrors(other.m_numErrors) {
198 m_destination = other.m_destination;
227 QMutexLocker locker(&m_errorsLock);
247 if (*m_numErrors != 0) {
250 tr(
"Failed to export [%1] images").arg(*m_numErrors),
virtual bool setupExecution()
This sets up the state for the work order.
ImageList * imageList()
Returns a pointer to the ImageList for this WorkOrder.
File name manipulation and expansion.
void postExecution()
Display any warnings that occurred during the asynchronous computations.
@ Unknown
A type of error that cannot be classified as any of the other error types.
IException errors() const
Get the accumulated error list from this functor's run.
void setInternalData(QStringList data)
Sets the internal data for this WorkOrder.
Cube * copy(FileName newFile, const CubeAttributeOutput &newFileAttributes)
Copies the cube to the new fileName.
Manipulate and parse attributes of output cube filenames.
QString fileName() const
Get the file name of the cube that this image represents.
bool m_isSynchronous
This is defaulted to true.
void append(const IException &exceptionSource)
Appends the given exception (and its list of previous exceptions) to this exception's causational exc...
Internalizes a list of images and allows for operations on the entire list.
QString baseName() const
Returns the name of the file without the path and without extensions.
ProjectImageExportFunctor(QString destination)
Create an image export functor that will copy the image's cubes into the given destination directory.
bool m_isUndoable
Set the workorder to be undoable/redoable This is defaulted to true - his will allow the workorder to...
~ProjectImageExportFunctor()
Destroys the functor.
QString toString() const
Returns a string representation of this exception.
void * operator()(Image *const &imageToExport)
Write the given image's cube into the destination folder (preserves the base name).
Cube * cube()
Get the Cube pointer associated with this display property.
void closeCube()
Cleans up the Cube pointer.
QString name() const
Get the human-readable name of this image list.
Project * project() const
Returns the Project this WorkOrder is attached to.
This represents a cube in a project-based GUI interface.
void setProgressRange(int, int)
Sets the progress range of the WorkOrder.
void execute()
Use internalData() and write the images into the output directory.
bool isExecutable(ImageList *images)
Currently, this work order only works with either no data (file menu) or with any number of images.
void setProgressValue(int)
Sets the current progress value for the WorkOrder.
QStringList internalData() const
Gets the internal data for this WorkOrder.
This functor is meant for QtConcurrentMap.
ImageList * imageList(QString name)
Return an imagelist given its name.
This is free and unencumbered software released into the public domain.
bool setupExecution()
Prompts the user for input.