Isis 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).
 
 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 (QStringList &)
 Creates an image list from a list of cube file names.
 
 ImageList (const ImageList &)
 Copy constructor.
 
 ~ImageList ()
 Destructor.
 
SerialNumberListserialNumberList ()
 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.
 
ImagetakeAt (int i)
 Removes the image at an index and returns it.
 
ImagetakeFirst ()
 Removes and returns the first image.
 
ImagetakeLast ()
 Removes and returns the last image.
 
ImageListoperator+= (const QList< Image * > &other)
 Appends a list of images to the end of the image list.
 
ImageListoperator+= (Image *const &other)
 Appends a single image to the end of the image list.
 
ImageListoperator<< (const QList< Image * > &other)
 Appends a list of images to the end of the image list.
 
ImageListoperator<< (Image *const &other)
 Appends a single image to the end of the image list.
 
ImageListoperator= (const QList< Image * > &rhs)
 Assigns another list of images to the image list.
 
ImageListoperator= (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
 

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/5]

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/5]

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

Creates a blank image list.

Parameters
parentThe Qt-relationship parent.

◆ ImageList() [3/5]

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/5]

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() [5/5]

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]

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

◆ append() [2/2]

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

◆ 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::ImportImagesWorkOrder::undoExecution().

◆ erase() [1/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().

◆ erase() [2/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().

◆ 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()

QString Isis::ImageList::name ( ) const

◆ 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 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 ImageList & rhs)

Assignment operator.

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

References countChanged().

◆ operator=() [2/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().

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

◆ 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::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)

◆ 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 Symbol Documentation

◆ ImageListActionWorkOrder

friend class ImageListActionWorkOrder
friend

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