Isis Developer Reference
|
Internalizes a list of images and allows for operations on the entire list. More...
#include <ImageList.h>
Signals | |
void | countChanged (int newCount) |
Public Member Functions | |
ImageList (QString name, QString path, QObject *parent=NULL) | |
Creates an image list from an image list name and path (does not read Images). | |
ImageList (QObject *parent=NULL) | |
Creates a blank image list. | |
ImageList (QList< Image * >, QObject *parent=NULL) | |
Creates an image list from a list of images. | |
ImageList (Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent=NULL) | |
Creates an image list from XML. | |
ImageList (QStringList &) | |
Creates an image list from a list of cube file names. | |
ImageList (const ImageList &) | |
Copy constructor. | |
~ImageList () | |
Destructor. | |
SerialNumberList * | serialNumberList () |
Creates a SerialNumberList from the image list. | |
void | append (Image *const &value) |
Appends an image to the image list. | |
void | append (const QList< Image * > &value) |
Appends a list of images to the image list. | |
void | clear () |
Clears the image list. | |
iterator | erase (iterator pos) |
Erases a single image from the image list. | |
iterator | erase (iterator begin, iterator end) |
Erases a range of images from the image list. | |
void | insert (int i, Image *const &value) |
Inserts an image into the image list at an index. | |
iterator | insert (iterator before, Image *const &value) |
Inserts an image into the image list after an iterator. | |
void | prepend (Image *const &value) |
Inserts an image at the beginning of the image list. | |
void | push_back (Image *const &value) |
Appends an image to the end of the image list. | |
void | push_front (Image *const &value) |
Prepends an image to the beginning of the image list. | |
int | removeAll (Image *const &value) |
Removes all occurances of an image. | |
void | removeAt (int i) |
Removes the image at an index. | |
void | removeFirst () |
Removes the image at the front of the image list. | |
void | removeLast () |
Removes the image at the end of the image list. | |
bool | removeOne (Image *const &value) |
Removes the first occurance of an image. | |
void | swap (QList< Image * > &other) |
Swaps the image list with another list of images. | |
Image * | takeAt (int i) |
Removes the image at an index and returns it. | |
Image * | takeFirst () |
Removes and returns the first image. | |
Image * | takeLast () |
Removes and returns the last image. | |
ImageList & | operator+= (const QList< Image * > &other) |
Appends a list of images to the end of the image list. | |
ImageList & | operator+= (Image *const &other) |
Appends a single image to the end of the image list. | |
ImageList & | operator<< (const QList< Image * > &other) |
Appends a list of images to the end of the image list. | |
ImageList & | operator<< (Image *const &other) |
Appends a single image to the end of the image list. | |
ImageList & | operator= (const QList< Image * > &rhs) |
Assigns another list of images to the image list. | |
ImageList & | operator= (const ImageList &rhs) |
Assignment operator. | |
QList< QAction * > | supportedActions (Project *project=NULL) |
Gets a list of pre-connected actions that have to do with display. | |
bool | allSupport (ImageDisplayProperties::Property prop) |
Check if all images in the image list support a display property. | |
void | setName (QString newName) |
Set the human-readable name of this image list. | |
void | setPath (QString newPath) |
Set the relative path (from the project root) to this image list's folder. | |
QString | name () const |
Get the human-readable name of this image list. | |
QString | path () const |
Get the path to the images in the image list (relative to project root). | |
void | deleteFromDisk (Project *project) |
Delete all of the contained Images from disk. | |
void | save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const |
Convert this image list into XML format for saving/restoring capabilities. | |
Friends | |
class | ImageListActionWorkOrder |
Internalizes a list of images and allows for operations on the entire list.
This class reads a list of images from an images.xml file and internalizes them as aQList of images. It also allows for modifications to the entire list of images and storing the image list as an images.xml file.
Isis::ImageList::ImageList | ( | QString | name, |
QString | path, | ||
QObject * | parent = NULL ) |
|
explicit |
Creates a blank image list.
parent | The Qt-relationship parent. |
Creates an image list from a list of images.
images | The list of images. |
parent | The Qt-relationship parent. |
References append().
|
explicit |
Creates an image list from XML.
project | The project with the image list. |
xmlReader | The XML reader currently at an <imageList > tag. |
parent | The Qt-relationship parent. |
|
explicit |
Creates an image list from a list of cube file names.
This is slow (serial) and not recommended.
fileNames | The list of cube fileNames. |
References append(), and Isis::Image::closeCube().
Isis::ImageList::ImageList | ( | const ImageList & | other | ) |
Copy constructor.
other | The image list to copy. |
Isis::ImageList::~ImageList | ( | ) |
Destructor.
This does not free the Images from memory.
bool Isis::ImageList::allSupport | ( | ImageDisplayProperties::Property | prop | ) |
Check if all images in the image list support a display property.
prop | The property we're testing for support for |
References Isis::Image::displayProperties(), and Isis::DisplayProperties::supports().
Referenced by supportedActions().
Appends a list of images to the image list.
value | the list of images to be appened. |
References countChanged().
void Isis::ImageList::append | ( | Image *const & | value | ) |
Appends an image to the image list.
value | The image to be appended. |
References countChanged().
Referenced by Isis::MosaicSceneItem::contextMenuEvent(), Isis::MosaicSceneWidget::contextMenuEvent(), ImageList(), ImageList(), Isis::MosaicSceneWidget::images(), Isis::WorkOrder::isExecutable(), Isis::MosaicSceneWidget::selectedImages(), Isis::WorkOrder::setData(), and Isis::RemoveImagesWorkOrder::setupExecution().
void Isis::ImageList::clear | ( | ) |
|
signal |
Referenced by append(), append(), clear(), erase(), erase(), insert(), insert(), operator+=(), operator+=(), operator<<(), operator<<(), operator=(), operator=(), prepend(), push_back(), push_front(), removeAll(), removeAt(), removeFirst(), removeLast(), removeOne(), swap(), takeAt(), takeFirst(), and takeLast().
void Isis::ImageList::deleteFromDisk | ( | Project * | project | ) |
Delete all of the contained Images from disk.
project | The project the images in the image list belong to. |
References Isis::Image::deleteFromDisk(), and Isis::Project::imageDataRoot().
Referenced by Isis::ImportImagesWorkOrder::undoExecution().
Erases a range of images from the image list.
Erases all images from begin up to (but not including) end.
begin | An iterator pointing to the first image to be erased. |
end | An iterator pointing to the image just after the last image to be erased. Will be invalid after the call. |
References countChanged().
Erases a single image from the image list.
pos | An iterator pointing to the image to be erased. |
References countChanged().
void Isis::ImageList::insert | ( | int | i, |
Image *const & | value ) |
Inserts an image into the image list at an index.
i | The index at which to insert the image. |
value | the image to be inserted. |
References countChanged().
Inserts an image into the image list after an iterator.
before | An iterator pointing to the image that value will be inserted after |
value | The image to be inserted. |
References countChanged().
QString Isis::ImageList::name | ( | ) | const |
Get the human-readable name of this image list.
Referenced by Isis::ImageFileListWidget::addImages(), Isis::Project::imageList(), ImageList(), Isis::ImageTreeWidgetItem::imageListName(), Isis::SetActiveImageListWorkOrder::isExecutable(), Isis::Project::removeImages(), save(), Isis::ProjectItem::setImageList(), and Isis::ExportImagesWorkOrder::setupExecution().
Appends a list of images to the end of the image list.
other | The list of images to be appended. |
References countChanged().
Appends a single image to the end of the image list.
other | The image to be appended. |
References countChanged().
Appends a list of images to the end of the image list.
other | The list of images to be appended. |
References countChanged().
Appends a single image to the end of the image list.
other | The image to be appended. |
References countChanged().
Assignment operator.
rhs | The right hand side of the '=' operator |
References countChanged().
Assigns another list of images to the image list.
rhs | The list of images that imageList will become a copy of. |
References countChanged().
QString Isis::ImageList::path | ( | ) | const |
Get the path to the images in the image list (relative to project root).
This only applies to an image list from the project.
Referenced by ImageList(), and Isis::ProjectItem::setImageList().
void Isis::ImageList::prepend | ( | Image *const & | value | ) |
Inserts an image at the beginning of the image list.
value | The image to be inserted. |
References countChanged().
void Isis::ImageList::push_back | ( | Image *const & | value | ) |
Appends an image to the end of the image list.
Equivalent to append().
value | The image to be appended. |
References countChanged().
void Isis::ImageList::push_front | ( | Image *const & | value | ) |
Prepends an image to the beginning of the image list.
Equivalent to prepend().
value | The image to be appended. |
References countChanged().
int Isis::ImageList::removeAll | ( | Image *const & | value | ) |
Removes all occurances of an image.
value | The image to be removed. |
References countChanged().
void Isis::ImageList::removeAt | ( | int | i | ) |
Removes the image at an index.
i | The index of the image to be removed. |
References countChanged().
void Isis::ImageList::removeFirst | ( | ) |
Removes the image at the front of the image list.
References countChanged().
void Isis::ImageList::removeLast | ( | ) |
Removes the image at the end of the image list.
References countChanged().
bool Isis::ImageList::removeOne | ( | Image *const & | value | ) |
Removes the first occurance of an image.
value | The image to be removed. |
References countChanged().
void Isis::ImageList::save | ( | QXmlStreamWriter & | stream, |
const Project * | project, | ||
FileName | newProjectRoot ) const |
Convert this image list into XML format for saving/restoring capabilities.
This writes:
<imageList name="..." path="...">
to the given xml stream, and creates an 'images.xml' inside the folder with the images. Inside the images.xml, this writes:
<images> ... </images>
stream | XmlStream to write out the document. |
project | The project the image list will be saved to. |
newProjectRoot | The path to the root directory for the new project. |
iException::Io | "Failed to create directory" |
iException::Io | "Unable to save image information because new file could not be opened for writing" |
References _FILEINFO_, Isis::FileName::dir(), Isis::Project::imageDataRoot(), Isis::IException::Io, name(), Isis::Project::newProjectRoot(), Isis::FileName::original(), Isis::FileName::path(), Isis::Project::projectRoot(), Isis::Image::save(), and Isis::FileName::toString().
SerialNumberList * Isis::ImageList::serialNumberList | ( | ) |
Creates a SerialNumberList from the image list.
References Isis::SerialNumberList::add().
void Isis::ImageList::setName | ( | QString | newName | ) |
Set the human-readable name of this image list.
This is really only useful for project image lists (not anonymous temporary ones).
newName | The name to give this image list |
Referenced by Isis::ProjectItemModel::setData().
void Isis::ImageList::setPath | ( | QString | newPath | ) |
Set the relative path (from the project root) to this image list's folder.
This is really only useful for project image lists (not anonymous temporary ones).
newPath | The path to the images in this image list |
Gets a list of pre-connected actions that have to do with display.
If any image does not support a given set of actions, then those will actions will be skipped for all images.
project | The project that owns the images in the imageList. |
References allSupport(), Isis::ImageListActionWorkOrder::ChangeColor, Isis::ImageListActionWorkOrder::ChangeTransparency, Isis::ImageDisplayProperties::Color, Isis::Image::displayProperties(), Isis::ImageListActionWorkOrder::MoveDownOne, Isis::ImageListActionWorkOrder::MoveToBottom, Isis::ImageListActionWorkOrder::MoveToTop, Isis::ImageListActionWorkOrder::MoveUpOne, Isis::ImageListActionWorkOrder::RandomizeColor, Isis::ImageDisplayProperties::ShowDNs, Isis::ImageDisplayProperties::ShowFill, Isis::ImageDisplayProperties::ShowLabel, Isis::ImageDisplayProperties::ShowOutline, Isis::ImageListActionWorkOrder::ToggleShowCubeData, Isis::ImageListActionWorkOrder::ToggleShowFilled, Isis::ImageListActionWorkOrder::ToggleShowLabel, Isis::ImageListActionWorkOrder::ToggleShowOutline, Isis::ImageListActionWorkOrder::ZoomFit, Isis::ImageDisplayProperties::Zooming, and Isis::ImageDisplayProperties::ZOrdering.
Referenced by Isis::MosaicSceneItem::contextMenuEvent(), and Isis::MosaicSceneWidget::contextMenuEvent().
Swaps the image list with another list of images.
other | The list of images to swapped with. |
References countChanged().
Image * Isis::ImageList::takeAt | ( | int | i | ) |
Removes the image at an index and returns it.
i | The index of the image to be removed and returned. |
References countChanged().
Image * Isis::ImageList::takeFirst | ( | ) |
Removes and returns the first image.
References countChanged().
Image * Isis::ImageList::takeLast | ( | ) |
Removes and returns the last image.
References countChanged().
|
friend |