1 #include "ImageListActionWorkOrder.h" 35 QUndoCommand::setText(
toString(action));
54 connect(
this, SIGNAL(bringToFront()), image->
displayProperties(), SIGNAL(moveToTop()));
85 return !images->isEmpty();
104 QUndoCommand::setText(modifiedString);
107 foreach (
Image *image, *images) {
108 connect(
this, SIGNAL(bringToFront()), image->
displayProperties(), SIGNAL(moveToTop()));
135 state.append(QString::number(alpha));
144 if (color.isValid()) {
154 int maxRecommendedLabels = 2000;
156 imageList()->count() > maxRecommendedLabels) {
157 QMessageBox::StandardButton selectedOpt = QMessageBox::warning(NULL,
158 tr(
"Potentially Slow Operation"),
159 tr(
"You are asking to show the labels on %L1 images. When viewing these images in " 160 "a 2D footprint view, these images will take at least 3x longer to render. This " 161 "is a significant performance loss. Showing more than a few labels at a time is " 162 "not recommended. Are you sure you want to show the labels on these %L1 images?")
164 QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
166 if (selectedOpt == QMessageBox::No) {
226 state = state.mid(0, 2);
231 state = state.mid(0, 2);
236 if (state.count() > 1) {
241 state.append(
imageList()->saveAndApplyRandomColor());
246 state = state.mid(0, 1);
247 state.append(
imageList()->saveAndToggleShowLabel());
251 state = state.mid(0, 1);
252 state.append(
imageList()->saveAndToggleShowFill());
256 state = state.mid(0, 1);
257 state.append(
imageList()->saveAndToggleShowDNs());
261 state = state.mid(0, 1);
262 state.append(
imageList()->saveAndToggleShowOutline());
363 QString result = unqualifiedString;
371 result = tr(
"Hide Label");
374 result = tr(
"Show Label");
380 result = tr(
"Show Unfilled");
383 result = tr(
"Show Filled");
389 result = tr(
"Hide Cube Data");
392 result = tr(
"Show Cube Data");
398 result = tr(
"Hide Outline");
401 result = tr(
"Show Outline");
426 result = tr(
"Change Transparency");
430 result = tr(
"Change Color");
434 result = tr(
"Randomize Color");
438 result = tr(
"Toggle Label");
442 result = tr(
"Toggle Show Filled");
446 result = tr(
"Toggle Show Cube Data");
450 result = tr(
"Toggle Show Outline");
454 result = tr(
"Bring to Front");
458 result = tr(
"Bring Forward");
462 result = tr(
"Send to Back");
466 result = tr(
"Send Backward");
470 result = tr(
"Zoom Fit");
486 QString actionString) {
489 for (
Action act = FirstAction;
491 act = (
Action)(act + 1)) {
492 if (
toString(act).toUpper() == actionString.toUpper()) {
True if the cube should show a fill area if possible (bool)
Internalizes a list of images and allows for operations on the entire list.
The main project for ipce.
Work orders that can be performed on an image list that modifies internal state.
Move the image to the front.
Action
Type of action to be performed by the work order.
~ImageListActionWorkOrder()
Destructor.
virtual bool setupExecution()
This sets up the state for the work order.
Show or hide each image's fill area.
void applyShowLabel(QStringList showLabelValues)
Sets the visibility of the display names of the images in the image list based on a list of values...
int toInt(const QString &string)
Global function to convert from a string to an integer.
void applyColors(QStringList colorValues, int column=0)
Sets the colors values of the images based on a list of values.
QVariant getValue(int property) const
Get a property's associated data.
True if the cube should be outlined (bool)
bool askNewColor(QColor *colorResult) const
Prompts the user for color values.
ImageListActionWorkOrder(Project *project)
Construct a work order for the given project.
bool isExecutable(ImageList *images)
Check if the work order can run on a given image list.
True if the cube should show DN values if possible (bool)
void setData(ImageList *images)
Assign an image list to the work order.
True if the cube should show its display name (bool)
static QString qualifyString(QString unqualifiedString, ImageList *)
Determine whether a toggle action should show or hide.
void execute()
Perform the action stored in the work order and update the work order's internal data with the result...
Change the alpha values of the image list.
Set each image in the list to a random color.
This is the GUI communication mechanism for cubes.
Provide Undo/redo abilities, serialization, and history for an operation.
static QColor fromRGBAString(QString)
Converts a QString to its QColor.
void applyShowFill(QStringList showFillValues)
Sets the visibility of the fill areas of the images in the image list based on a list of values...
This represents a cube in a project-based GUI interface.
void applyShowOutline(QStringList showOutlineValues)
Sets the visibility of the outlines of the images in the image list based on a list of values...
ImageDisplayProperties * displayProperties()
Get the display (GUI) properties (information) associated with this image.
virtual void setData(Context)
Sets the context data for this WorkOrder.
void applyAlphas(QStringList alphaValues)
Sets the alpha values of the images based on a list of values.
static Action fromActionString(QString)
Convert a string to an action.
void undoExecution()
Undo the action stored in the work order and update the work order's internal data with the results o...
static QString toRGBAString(QColor)
Convert a QColor to its QString.
Show or hide each image's outline.
Move the image to the back.
ImageListActionWorkOrder * clone() const
Clone the current work order.
Show or hide each image's DNs.
Change the color values of the image list.
void applyShowDNs(QStringList showDNsValues)
Sets the visibility of the DNs of the images in the image list based on a list of values...
Zoom in on the image so that it fits the screen.
Namespace for ISIS/Bullet specific routines.
static QString toString(Action)
Convert an action to a string.
ImageList * imageList()
Returns a pointer to the ImageList for this WorkOrder.
bool setupExecution()
If needed, prompt the user for input and save it.
bool m_isSavedToHistory
Set the work order to be shown in the HistoryTreeWidget.
QStringList internalData() const
Gets the internal data for this WorkOrder.
void setInternalData(QStringList data)
Sets the internal data for this WorkOrder.
Show or hide each image's display name.
bool askAlpha(int *alphaResult) const
Prompts the user for an alpha value.