Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis Developer Reference
ImageList.h
Go to the documentation of this file.
1#ifndef ImageList_H
2#define ImageList_H
3
4#include <QDebug>
5#include <QObject>
6#include <QList>
7#include <QMetaType>
8#include <QSharedPointer>
9
10#include "Image.h"
13#include "SerialNumberList.h"
14#include "WorkOrder.h"
15
16class QXmlStreamWriter;
17
18namespace Isis {
19 class FileName;
20
52 class ImageList : public QObject, public QList<Image *> {
53 Q_OBJECT
54
55 public:
57
58 ImageList(QString name, QString path, QObject *parent = NULL);
59 explicit ImageList(QObject *parent = NULL);
60 explicit ImageList(QList<Image *>, QObject *parent = NULL);
61 explicit ImageList(QStringList &);
62 ImageList(const ImageList &);
63 ~ImageList();
64
65// QSharedPointer<SerialNumberList> serialNumberList();
67
68 // These are overridden (-ish) in order to add notifications to the list changing
69 void append(Image * const & value);
70 void append(const QList<Image *> &value);
71
72 void clear();
73
75 iterator erase(iterator begin, iterator end);
76
77 void insert(int i, Image * const & value);
78 iterator insert(iterator before, Image * const & value);
79
80 void prepend(Image * const & value);
81 void push_back(Image * const & value);
82 void push_front(Image * const & value);
83 int removeAll(Image * const & value);
84 void removeAt(int i);
85 void removeFirst();
86 void removeLast();
87 bool removeOne(Image * const & value);
88 void swap(QList<Image *> &other);
89 Image *takeAt(int i);
91 Image *takeLast();
92
93 ImageList &operator+=(const QList<Image *> &other);
94 ImageList &operator+=(Image * const &other);
95 ImageList &operator<<(const QList<Image *> &other);
96 ImageList &operator<<(Image * const &other);
98
99 // This is our own assignment, but it needs to notify just like the operator=(QList)
100 ImageList &operator=(const ImageList &rhs);
101
102 // Done overriding (-ish)
103
104
107
108 void setName(QString newName);
109 void setPath(QString newPath);
110
111 QString name() const;
112 QString path() const;
113
114 void deleteFromDisk(Project *project);
115 void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
116
117 signals:
118 void countChanged(int newCount);
119
120 private:
121
131 class CopyImageDataFunctor : public std::function<void *(Image * const &)> {
132 public:
133 CopyImageDataFunctor(const Project *project, FileName newProjectRoot);
134 CopyImageDataFunctor(const CopyImageDataFunctor &other);
135 ~CopyImageDataFunctor();
136
137 void *operator()(Image * const &imageToCopy);
138
139 CopyImageDataFunctor &operator=(const CopyImageDataFunctor &rhs);
140
141 private:
145 const Project *m_project;
149 FileName m_newProjectRoot;
150 };
151
152 private:
161 QAction *createWorkOrder(Project *project, ImageListActionWorkOrder::Action action) {
162 QAction *result = NULL;
163
164 if (project) {
165 result = new ImageListActionWorkOrder(action, project);
166 ((ImageListActionWorkOrder *)result)->setData(this);
167 }
168 else {
169 result = new QAction(
171 this),
172 this);
173 }
174
175 return result;
176 }
177
178 void applyAlphas(QStringList alphaValues);
179 void applyColors(QStringList colorValues, int column = 0);
180 void applyShowLabel(QStringList showLabelValues);
181 void applyShowFill(QStringList showFillValues);
182 void applyShowDNs(QStringList showDNsValues);
183 void applyShowOutline(QStringList showOutlineValues);
184 bool askAlpha(int *alphaResult) const;
185 bool askNewColor(QColor *colorResult) const;
186 QStringList saveAndApplyAlpha(int newAlpha);
187 QStringList saveAndApplyColor(QColor newColor);
188 QStringList saveAndApplyRandomColor();
189
190 private slots:
191 void askAndUpdateAlpha();
192 void askAndUpdateColor();
193 void showRandomColor();
194 QStringList saveAndToggleShowDNs();
195 QStringList saveAndToggleShowFill();
196 QStringList saveAndToggleShowLabel();
197 QStringList saveAndToggleShowOutline();
198
199 private:
203 QString m_name;
204
215 QString m_path;
216 };
217
218}
219
221
222#endif
Q_DECLARE_METATYPE(Isis::ImageList *)
Property
This is a list of properties and actions that are possible.
Definition ImageDisplayProperties.h:90
This represents a cube in a project-based GUI interface.
Definition Image.h:105
Work orders that can be performed on an image list that modifies internal state.
Definition ImageListActionWorkOrder.h:60
static QString toString(Action)
Convert an action to a string.
Definition ImageListActionWorkOrder.cpp:417
static QString qualifyString(QString unqualifiedString, ImageList *)
Determine whether a toggle action should show or hide.
Definition ImageListActionWorkOrder.cpp:361
Action
Type of action to be performed by the work order.
Definition ImageListActionWorkOrder.h:67
Internalizes a list of images and allows for operations on the entire list.
Definition ImageList.h:52
Image * takeLast()
Removes and returns the last image.
Definition ImageList.cpp:408
void deleteFromDisk(Project *project)
Delete all of the contained Images from disk.
Definition ImageList.cpp:733
int removeAll(Image *const &value)
Removes all occurances of an image.
Definition ImageList.cpp:289
QString path() const
Get the path to the images in the image list (relative to project root).
Definition ImageList.cpp:721
~ImageList()
Destructor.
Definition ImageList.cpp:112
ImageList & operator+=(const QList< Image * > &other)
Appends a list of images to the end of the image list.
Definition ImageList.cpp:425
ImageList & operator<<(const QList< Image * > &other)
Appends a list of images to the end of the image list.
Definition ImageList.cpp:463
void setPath(QString newPath)
Set the relative path (from the project root) to this image list's folder.
Definition ImageList.cpp:700
void insert(int i, Image *const &value)
Inserts an image into the image list at an index.
Definition ImageList.cpp:215
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Convert this image list into XML format for saving/restoring capabilities.
Definition ImageList.cpp:771
bool removeOne(Image *const &value)
Removes the first occurance of an image.
Definition ImageList.cpp:344
Image * takeAt(int i)
Removes the image at an index and returns it.
Definition ImageList.cpp:380
void push_front(Image *const &value)
Prepends an image to the beginning of the image list.
Definition ImageList.cpp:274
Image * takeFirst()
Removes and returns the first image.
Definition ImageList.cpp:394
ImageList & operator=(const QList< Image * > &rhs)
Assigns another list of images to the image list.
Definition ImageList.cpp:500
void prepend(Image *const &value)
Inserts an image at the beginning of the image list.
Definition ImageList.cpp:246
ImageList(QString name, QString path, QObject *parent=NULL)
Creates an image list from an image list name and path (does not read Images).
Definition ImageList.cpp:53
iterator erase(iterator pos)
Erases a single image from the image list.
Definition ImageList.cpp:181
SerialNumberList * serialNumberList()
Creates a SerialNumberList from the image list.
Definition ImageList.cpp:121
void removeAt(int i)
Removes the image at an index.
Definition ImageList.cpp:307
void push_back(Image *const &value)
Appends an image to the end of the image list.
Definition ImageList.cpp:260
bool allSupport(ImageDisplayProperties::Property prop)
Check if all images in the image list support a display property.
Definition ImageList.cpp:670
void append(Image *const &value)
Appends an image to the image list.
Definition ImageList.cpp:139
friend class ImageListActionWorkOrder
Definition ImageList.h:56
QList< QAction * > supportedActions(Project *project=NULL)
Gets a list of pre-connected actions that have to do with display.
Definition ImageList.cpp:551
void swap(QList< Image * > &other)
Swaps the image list with another list of images.
Definition ImageList.cpp:362
void setName(QString newName)
Set the human-readable name of this image list.
Definition ImageList.cpp:689
QString name() const
Get the human-readable name of this image list.
Definition ImageList.cpp:710
void countChanged(int newCount)
void clear()
Clears the image list.
Definition ImageList.cpp:163
void removeFirst()
Removes the image at the front of the image list.
Definition ImageList.cpp:318
void removeLast()
Removes the image at the end of the image list.
Definition ImageList.cpp:329
The main project for ipce.
Definition Project.h:287
Serial Number list generator.
Definition SerialNumberList.h:64
This is free and unencumbered software released into the public domain.
Definition BoxcarCachingAlgorithm.h:13
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16