Isis 3 Developer Reference
Isis::ImageList Class Reference

Internalizes a list of images and allows for operations on the entire list. More...

#include <ImageList.h>

Inheritance diagram for Isis::ImageList:
Inheritance graph
Collaboration diagram for Isis::ImageList:
Collaboration graph

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). More...
 
 ImageList (QObject *parent=NULL)
 Creates a blank image list. More...
 
 ImageList (QList< Image *>, QObject *parent=NULL)
 Creates an image list from a list of images. More...
 
 ImageList (Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent=NULL)
 Creates an image list from XML. More...
 
 ImageList (QStringList &)
 Creates an image list from a list of cube file names. More...
 
 ImageList (const ImageList &)
 Copy constructor. More...
 
 ~ImageList ()
 Destructor. More...
 
SerialNumberListserialNumberList ()
 Creates a SerialNumberList from the image list. More...
 
void append (Image *const &value)
 Appends an image to the image list. More...
 
void append (const QList< Image *> &value)
 Appends a list of images to the image list. More...
 
void clear ()
 Clears the image list. More...
 
iterator erase (iterator pos)
 Erases a single image from the image list. More...
 
iterator erase (iterator begin, iterator end)
 Erases a range of images from the image list. More...
 
void insert (int i, Image *const &value)
 Inserts an image into the image list at an index. More...
 
iterator insert (iterator before, Image *const &value)
 Inserts an image into the image list after an iterator. More...
 
void prepend (Image *const &value)
 Inserts an image at the beginning of the image list. More...
 
void push_back (Image *const &value)
 Appends an image to the end of the image list. More...
 
void push_front (Image *const &value)
 Prepends an image to the beginning of the image list. More...
 
int removeAll (Image *const &value)
 Removes all occurances of an image. More...
 
void removeAt (int i)
 Removes the image at an index. More...
 
void removeFirst ()
 Removes the image at the front of the image list. More...
 
void removeLast ()
 Removes the image at the end of the image list. More...
 
bool removeOne (Image *const &value)
 Removes the first occurance of an image. More...
 
void swap (QList< Image *> &other)
 Swaps the image list with another list of images. More...
 
ImagetakeAt (int i)
 Removes the image at an index and returns it. More...
 
ImagetakeFirst ()
 Removes and returns the first image. More...
 
ImagetakeLast ()
 Removes and returns the last image. More...
 
ImageListoperator+= (const QList< Image *> &other)
 Appends a list of images to the end of the image list. More...
 
ImageListoperator+= (Image *const &other)
 Appends a single image to the end of the image list. More...
 
ImageListoperator<< (const QList< Image *> &other)
 Appends a list of images to the end of the image list. More...
 
ImageListoperator<< (Image *const &other)
 Appends a single image to the end of the image list. More...
 
ImageListoperator= (const QList< Image *> &rhs)
 Assigns another list of images to the image list. More...
 
ImageListoperator= (const ImageList &rhs)
 Assignment operator. More...
 
QList< QAction * > supportedActions (Project *project=NULL)
 Gets a list of pre-connected actions that have to do with display. More...
 
bool allSupport (ImageDisplayProperties::Property prop)
 Check if all images in the image list support a display property. More...
 
void setName (QString newName)
 Set the human-readable name of this image list. More...
 
void setPath (QString newPath)
 Set the relative path (from the project root) to this image list's folder. More...
 
QString name () const
 Get the human-readable name of this image list. More...
 
QString path () const
 Get the path to the images in the image list (relative to project root). More...
 
void deleteFromDisk (Project *project)
 Delete all of the contained Images from disk. More...
 
void save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
 Convert this image list into XML format for saving/restoring capabilities. More...
 

Friends

class ImageListActionWorkOrder
 

Detailed Description

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.

Author
2012-??-?? ???

Constructor & Destructor Documentation

◆ ImageList() [1/6]

Isis::ImageList::ImageList ( QString  name,
QString  path,
QObject parent = NULL 
)

Creates an image list from an image list name and path (does not read Images).

Parameters
nameThe ImageList's name (i.e. import1, import2, ...).
pathThe ImageList's folder name (i.e. import1, import2, ...).
parentThe Qt-relationship parent.

References name(), and path().

◆ ImageList() [2/6]

Isis::ImageList::ImageList ( QObject parent = NULL)
explicit

Creates a blank image list.

Parameters
parentThe Qt-relationship parent.

◆ ImageList() [3/6]

Isis::ImageList::ImageList ( QList< Image *>  images,
QObject parent = NULL 
)
explicit

Creates an image list from a list of images.

Parameters
imagesThe list of images.
parentThe Qt-relationship parent.

References append().

◆ ImageList() [4/6]

Isis::ImageList::ImageList ( Project project,
XmlStackedHandlerReader xmlReader,
QObject parent = NULL 
)
explicit

Creates an image list from XML.

Parameters
projectThe project with the image list.
xmlReaderThe XML reader currently at an <imageList> tag.
parentThe Qt-relationship parent.

References Isis::XmlStackedHandlerReader::pushContentHandler().

◆ ImageList() [5/6]

Isis::ImageList::ImageList ( QStringList fileNames)
explicit

Creates an image list from a list of cube file names.

This is slow (serial) and not recommended.

Parameters
fileNamesThe list of cube fileNames.

References append(), and Isis::Image::closeCube().

◆ ImageList() [6/6]

Isis::ImageList::ImageList ( const ImageList other)

Copy constructor.

Parameters
otherThe image list to copy.

◆ ~ImageList()

Isis::ImageList::~ImageList ( )

Destructor.

This does not free the Images from memory.

Member Function Documentation

◆ allSupport()

bool Isis::ImageList::allSupport ( ImageDisplayProperties::Property  prop)

Check if all images in the image list support a display property.

Parameters
propThe property we're testing for support for
Returns
bool True if all images in the Image List support the property. Otherwise, false.

References Isis::Image::displayProperties(), and Isis::DisplayProperties::supports().

Referenced by supportedActions().

◆ append() [1/2]

◆ append() [2/2]

void Isis::ImageList::append ( const QList< Image *> &  value)

Appends a list of images to the image list.

Parameters
valuethe list of images to be appened.
See also
QList<Image *>::append().

References countChanged().

◆ clear()

void Isis::ImageList::clear ( )

Clears the image list.

See also
QList<Image *>::clear().

References countChanged().

◆ countChanged

◆ deleteFromDisk()

void Isis::ImageList::deleteFromDisk ( Project project)

Delete all of the contained Images from disk.

Parameters
projectThe project the images in the image list belong to.
See also
Image::deleteFromDisk()

References Isis::Image::deleteFromDisk(), and Isis::Project::imageDataRoot().

Referenced by Isis::Project::deleteAllProjectFiles(), and Isis::ImportImagesWorkOrder::undoExecution().

◆ erase() [1/2]

QList< Image * >::iterator Isis::ImageList::erase ( iterator  pos)

Erases a single image from the image list.

Parameters
posAn iterator pointing to the image to be erased.
Returns
QList::iterator An iterator pointing to the image after the image that was removed.
See also
QList<Image *>::erase()

References countChanged().

◆ erase() [2/2]

QList< Image * >::iterator Isis::ImageList::erase ( iterator  begin,
iterator  end 
)

Erases a range of images from the image list.

Erases all images from begin up to (but not including) end.

Parameters
beginAn iterator pointing to the first image to be erased.
endAn iterator pointing to the image just after the last image to be erased. Will be invalid after the call.
Returns
QList::iterator An iterator pointing to the image end refered to before the call.
See also
QList<Image *>::erase()

References countChanged().

◆ insert() [1/2]

void Isis::ImageList::insert ( int  i,
Image *const &  value 
)

Inserts an image into the image list at an index.

Parameters
iThe index at which to insert the image.
valuethe image to be inserted.
See also
QList<Image *>::insert()

References countChanged().

◆ insert() [2/2]

QList< Image * >::iterator Isis::ImageList::insert ( iterator  before,
Image *const &  value 
)

Inserts an image into the image list after an iterator.

Parameters
beforeAn iterator pointing to the image that value will be inserted after
valueThe image to be inserted.
Returns
QList::iterator An iterator pointing to the inserted image.
See also
QList<Image *>::insert()

References countChanged().

◆ name()

◆ operator+=() [1/2]

ImageList & Isis::ImageList::operator+= ( const QList< Image *> &  other)

Appends a list of images to the end of the image list.

Parameters
otherThe list of images to be appended.
Returns
ImageList & A reference to the imageList.
See also
append()
QList<Image *>::operator+=()

References countChanged().

◆ operator+=() [2/2]

ImageList & Isis::ImageList::operator+= ( Image *const &  other)

Appends a single image to the end of the image list.

Parameters
otherThe image to be appended.
Returns
ImageList & A reference to the imageList.
See also
append()
QList<Image *>::operator+=()

References countChanged().

◆ operator<<() [1/2]

ImageList & Isis::ImageList::operator<< ( const QList< Image *> &  other)

Appends a list of images to the end of the image list.

Parameters
otherThe list of images to be appended.
Returns
ImageList & A reference to the imageList.
See also
append()
QList<Image *>::operator<<()

References operator<<().

◆ operator<<() [2/2]

ImageList & Isis::ImageList::operator<< ( Image *const &  other)

Appends a single image to the end of the image list.

Parameters
otherThe image to be appended.
Returns
ImageList & A reference to the imageList.
See also
append()
QList<Image *>::operator<<()

References countChanged(), and operator<<().

◆ operator=() [1/2]

ImageList & Isis::ImageList::operator= ( const QList< Image *> &  rhs)

Assigns another list of images to the image list.

Parameters
rhsThe list of images that imageList will become a copy of.
Returns
ImageList & A reference to the imageList.
See also
QList<Image *>::operator=()

References countChanged().

◆ operator=() [2/2]

ImageList & Isis::ImageList::operator= ( const ImageList rhs)

Assignment operator.

Parameters
rhsThe right hand side of the '=' operator
Returns
ImageList & This image list.

References countChanged().

◆ path()

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.

Returns
QString The path to the images in the image list (or an empty string if unknown).

Referenced by ImageList(), and Isis::ProjectItem::setImageList().

◆ prepend()

void Isis::ImageList::prepend ( Image *const &  value)

Inserts an image at the beginning of the image list.

Parameters
valueThe image to be inserted.
See also
QList<Image *>::prepend()

References countChanged().

◆ push_back()

void Isis::ImageList::push_back ( Image *const &  value)

Appends an image to the end of the image list.

Equivalent to append().

Parameters
valueThe image to be appended.
See also
QList<Image *>::push_back()

References countChanged().

◆ push_front()

void Isis::ImageList::push_front ( Image *const &  value)

Prepends an image to the beginning of the image list.

Equivalent to prepend().

Parameters
valueThe image to be appended.
See also
QList<Image *>::push_front()

References countChanged().

◆ removeAll()

int Isis::ImageList::removeAll ( Image *const &  value)

Removes all occurances of an image.

Parameters
valueThe image to be removed.
Returns
int The number of occurances of the image.
See also
QList<Image *>::removeAll()

References countChanged().

Referenced by Isis::RemoveImagesWorkOrder::execute().

◆ removeAt()

void Isis::ImageList::removeAt ( int  i)

Removes the image at an index.

Parameters
iThe index of the image to be removed.
See also
QList<Image *>::removeAt()

References countChanged().

◆ removeFirst()

void Isis::ImageList::removeFirst ( )

Removes the image at the front of the image list.

See also
QList<Image *>::removeFirst()

References countChanged().

◆ removeLast()

void Isis::ImageList::removeLast ( )

Removes the image at the end of the image list.

See also
QList<Image *>::removeLast()

References countChanged().

◆ removeOne()

bool Isis::ImageList::removeOne ( Image *const &  value)

Removes the first occurance of an image.

Parameters
valueThe image to be removed.
Returns
bool True if successful, otherwise false.
See also
QList<Image *>::removeOne()

References countChanged().

◆ save()

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>
Parameters
streamXmlStream to write out the document.
projectThe project the image list will be saved to.
newProjectRootThe path to the root directory for the new project.
Exceptions
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::ReadWrite, Isis::Image::save(), and Isis::FileName::toString().

◆ serialNumberList()

SerialNumberList * Isis::ImageList::serialNumberList ( )

Creates a SerialNumberList from the image list.

Returns
SerialNumberList The list of serial numbers for the cubes in the ImageList.

References Isis::SerialNumberList::add().

◆ setName()

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).

Parameters
newNameThe name to give this image list

Referenced by Isis::ProjectItemModel::setData().

◆ setPath()

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).

Parameters
newPathThe path to the images in this image list

◆ supportedActions()

QList< QAction * > Isis::ImageList::supportedActions ( Project project = NULL)

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.

Parameters
projectThe project that owns the images in the imageList.
Returns
QList<QAction *> A list of connected actions. The actions are as follows: ChangeTransparency, ChangeColor, RandomColor, ToggleShowLabel, ToggleShowFilled, ToggleShowCubeData, ToggleShowOutline.

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(), Isis::ImageTreeWidget::contextMenuEvent(), and Isis::MosaicSceneWidget::contextMenuEvent().

◆ swap()

void Isis::ImageList::swap ( QList< Image *> &  other)

Swaps the image list with another list of images.

Parameters
otherThe list of images to swapped with.
See also
QList<Image *>::swap()

References countChanged().

◆ takeAt()

Image * Isis::ImageList::takeAt ( int  i)

Removes the image at an index and returns it.

Parameters
iThe index of the image to be removed and returned.
Returns
Image * The removed image.
See also
QList<Image *>::takeAt()

References countChanged().

◆ takeFirst()

Image * Isis::ImageList::takeFirst ( )

Removes and returns the first image.

Returns
Image * The first image.
See also
QList<Image *>::takeFirst()

References countChanged().

◆ takeLast()

Image * Isis::ImageList::takeLast ( )

Removes and returns the last image.

Returns
Image * The last image.
See also
QList<Image *>::takeLast()

References countChanged().

Friends And Related Function Documentation

◆ ImageListActionWorkOrder

friend class ImageListActionWorkOrder
friend

The documentation for this class was generated from the following files: