Isis Developer Reference
Isis::TargetBodyList Class Reference

List for holding TargetBodies. More...

#include <TargetBodyList.h>

Inheritance diagram for Isis::TargetBodyList:
Inheritance graph
Collaboration diagram for Isis::TargetBodyList:
Collaboration graph

Signals

void countChanged (int newCount)
 

Public Member Functions

 TargetBodyList (QString name, QString path, QObject *parent=NULL)
 Create an target body list from an target body list name and path (does not read TargetBody objects).
 
 TargetBodyList (QObject *parent=NULL)
 Create a blank target body list.
 
 TargetBodyList (QList< TargetBodyQsp >, QObject *parent=NULL)
 Create a target body list from a list of TargetBody's.
 
 TargetBodyList (Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent=NULL)
 Create an image list from XML.
 
 TargetBodyList (const TargetBodyList &)
 Copy constructor.
 
 ~TargetBodyList ()
 Create an target body list from a list of target body file names.
 
void append (TargetBodyQsp const &value)
 Appends a TargetBody to the list.
 
void append (const QList< TargetBodyQsp > &value)
 Appends a TargetBodyList to the list.
 
void clear ()
 clears the list.
 
iterator erase (iterator pos)
 Erases the TargetBody associated with an iterator.
 
iterator erase (iterator begin, iterator end)
 Erases all TargetBodies starting with the TargetBody associated with begin up to, but not including, the TargetBody associated with end.
 
void insert (int i, TargetBodyQsp const &value)
 Inserts a TargetBody at a specific index.
 
iterator insert (iterator before, TargetBodyQsp const &value)
 Inserts a TargetBody after the TargetBody associated with an iterator.
 
void prepend (TargetBodyQsp const &value)
 Inserts a TargetBody at the front of the list.
 
void push_back (TargetBodyQsp const &value)
 Appends a TargetBody to the end of the list.
 
void push_front (TargetBodyQsp const &value)
 Insertes a TargetBody at the front of the list.
 
int removeAll (TargetBodyQsp const &value)
 Removes all occurrences of a TargetBody and returns the number removed.
 
void removeAt (int i)
 Removes the TargetBody at a specific index.
 
void removeFirst ()
 Removes the first TargetBody from the list.
 
void removeLast ()
 Removes the last TargetBody from the list.
 
bool removeOne (TargetBodyQsp const &value)
 Removes the first occurrence of a TargetBody from the list.
 
void swap (QList< TargetBodyQsp > &other)
 Swaps the list with another TargetBodyList.
 
TargetBodyQsp takeAt (int i)
 Removes and returns the TargetBody at a specific index.
 
TargetBodyQsp takeFirst ()
 Removes and returns the first TargetBody in the list.
 
TargetBodyQsp takeLast ()
 Removes and returns the last TargetBody in the list.
 
TargetBodyListoperator+= (const QList< TargetBodyQsp > &other)
 Appends another TargetBodyList to the list.
 
TargetBodyListoperator+= (TargetBodyQsp const &other)
 Appends a TargetBody to the list.
 
TargetBodyListoperator<< (const QList< TargetBodyQsp > &other)
 Appends another TargetBodyList to the list.
 
TargetBodyListoperator<< (TargetBodyQsp const &other)
 Appends a TargetBody to the list.
 
TargetBodyListoperator= (const QList< TargetBodyQsp > &rhs)
 Assignment operator for a QList of TargetBodyQsp.
 
TargetBodyListoperator= (const TargetBodyList &rhs)
 Assignment operator.
 
QList< QAction * > supportedActions (Project *project=NULL)
 
bool allSupport (TargetBodyDisplayProperties::Property prop)
 
void setName (QString newName)
 Gets a list of pre-connected actions that have to do with display, such as color, alpha, outline, fill, etc.
 
void setPath (QString newPath)
 Set the relative path (from the project root) to this target body list's folder.
 
QString name () const
 Get the human-readable name of this target body list.
 
QString path () const
 Get the path to these target body objects in the list (relative to project root).
 
void save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
 Delete all of the contained TargetBody objects from disk (see TargetBody::deleteFromDisk())
 

Detailed Description

List for holding TargetBodies.

Overrides several QList methods in order to emit signals about the list changing. TargetBodies are stored as QSharedPointer<TargetBody>.

Author
2015-06-11 Ken Edmundson

Constructor & Destructor Documentation

◆ TargetBodyList() [1/5]

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

Create an target body list from an target body list name and path (does not read TargetBody objects).

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

References name(), and path().

◆ TargetBodyList() [2/5]

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

Create a blank target body list.

Parameters
parentThe Qt-relationship parent

◆ TargetBodyList() [3/5]

Isis::TargetBodyList::TargetBodyList ( QList< TargetBodyQsp > targetBodys,
QObject * parent = NULL )
explicit

Create a target body list from a list of TargetBody's.

Parameters
targetBodysThe list of targetBody's
parentThe Qt-relationship parent

References append().

◆ TargetBodyList() [4/5]

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

Create an image list from XML.

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

◆ TargetBodyList() [5/5]

Isis::TargetBodyList::TargetBodyList ( const TargetBodyList & other)

Copy constructor.

Parameters
otherThe TargetBodyList to copy

◆ ~TargetBodyList()

Isis::TargetBodyList::~TargetBodyList ( )

Create an target body list from a list of target body file names.

This is slow (serial) and not recommended. Destructor. This does not free the TargetBody objects from memory.

Member Function Documentation

◆ allSupport()

bool Isis::TargetBodyList::allSupport ( TargetBodyDisplayProperties::Property prop)

◆ append() [1/2]

void Isis::TargetBodyList::append ( const QList< TargetBodyQsp > & value)

Appends a TargetBodyList to the list.

Parameters
valuethe TargetBodyList to append
See also
QList<TargetBodyQsp>::append()

References countChanged().

◆ append() [2/2]

void Isis::TargetBodyList::append ( TargetBodyQsp const & value)

Appends a TargetBody to the list.

Parameters
valueThe TargetBody to append
See also
QList<TargetBodyQsp>::append()

References countChanged().

Referenced by Isis::Project::addTarget(), and TargetBodyList().

◆ clear()

void Isis::TargetBodyList::clear ( )

clears the list.

See also
QList<TargetBodyQsp>::clear()

References countChanged().

Referenced by Isis::Project::clear().

◆ countChanged

◆ erase() [1/2]

QList< TargetBodyQsp >::iterator Isis::TargetBodyList::erase ( iterator begin,
iterator end )

Erases all TargetBodies starting with the TargetBody associated with begin up to, but not including, the TargetBody associated with end.

Parameters
beginAn iterator associated with the first TargetBody to be erased.
endAn iterator associated with the TargetBody after the last TargetBody to be erased
Returns
QList<TargetBodyQsp>::iterator An iterator associated with the TargetBody end was associated with before erasing.
See also
QList<TargetBodyQsp>::erase()

References countChanged().

◆ erase() [2/2]

QList< TargetBodyQsp >::iterator Isis::TargetBodyList::erase ( iterator pos)

Erases the TargetBody associated with an iterator.

Parameters
posAn iterator associated with the TaretBody to be erased
See also
QList<TargetBodyQsp>::erase()

References countChanged().

◆ insert() [1/2]

void Isis::TargetBodyList::insert ( int i,
TargetBodyQsp const & value )

Inserts a TargetBody at a specific index.

Parameters
iThe index at which to insert the TargetBody
valueThe TargetBody to insert
See also
QList<TargetBodyQsp>::insert()

References countChanged().

◆ insert() [2/2]

QList< TargetBodyQsp >::iterator Isis::TargetBodyList::insert ( iterator before,
TargetBodyQsp const & value )

Inserts a TargetBody after the TargetBody associated with an iterator.

Parameters
beforeAn iterator associated with the TargetBody that will be before the inserted TargetBody
valueThe TargetBody to be inserted
Returns
QList<TargetBodyQsp>::iterator An iterator associated with the inserted TargetBody
See also
QList<TargetBodyQsp>::insert()

References countChanged().

◆ name()

QString Isis::TargetBodyList::name ( ) const

Get the human-readable name of this target body list.

Returns
QString The name of the target body list (or an empty string if anonymous).

Referenced by TargetBodyList().

◆ operator+=() [1/2]

TargetBodyList & Isis::TargetBodyList::operator+= ( const QList< TargetBodyQsp > & other)

Appends another TargetBodyList to the list.

Parameters
otherThe TargetBodyList to be appended
Returns
TargetBodyList & A reference to this list.
See also
QList<TargetBodyQsp>::operator+=()

References countChanged().

◆ operator+=() [2/2]

TargetBodyList & Isis::TargetBodyList::operator+= ( TargetBodyQsp const & other)

Appends a TargetBody to the list.

Parameters
otherThe TargetBody to be appended
Returns
TargetBodyList & A reference to this list.
See also
QList<TargetBodyQsp>::operator+=()

References countChanged().

◆ operator<<() [1/2]

TargetBodyList & Isis::TargetBodyList::operator<< ( const QList< TargetBodyQsp > & other)

Appends another TargetBodyList to the list.

Parameters
otherThe TargetBodyList to be appended
Returns
TargetBodyList & A reference to this list.
See also
QList<TargetBodyQsp>::operator<<()

References countChanged().

◆ operator<<() [2/2]

TargetBodyList & Isis::TargetBodyList::operator<< ( TargetBodyQsp const & other)

Appends a TargetBody to the list.

Parameters
otherThe TargetBody to be appended
Returns
TargetBodyList & A reference to this list.
See also
QList<TargetBodyQsp>::operator<<()

References countChanged().

◆ operator=() [1/2]

TargetBodyList & Isis::TargetBodyList::operator= ( const QList< TargetBodyQsp > & rhs)

Assignment operator for a QList of TargetBodyQsp.

Parameters
rhsThe right hand side of the '=' operator
Returns
TargetBodyList & A reference to this list
See also
QList<TargetBodyQsp>::operator=()

References countChanged().

◆ operator=() [2/2]

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

Assignment operator.

Parameters
rhsThe right hand side of the '=' operator
Returns
TargetBodyList & A reference to this list

References countChanged().

◆ path()

QString Isis::TargetBodyList::path ( ) const

Get the path to these target body objects in the list (relative to project root).

This only applies to a target body list from the project.

Returns
QString The path to the target body objects in the list (or an empty string if unknown).

Referenced by TargetBodyList().

◆ prepend()

void Isis::TargetBodyList::prepend ( TargetBodyQsp const & value)

Inserts a TargetBody at the front of the list.

Parameters
valuethe TargetBody to be inserted
See also
QList<TargetBodyQsp>::prepend()

References countChanged().

◆ push_back()

void Isis::TargetBodyList::push_back ( TargetBodyQsp const & value)

Appends a TargetBody to the end of the list.

Parameters
valueThe TargetBody to be append
See also
QList<TargetBodyQsp>::push_back()

References countChanged().

◆ push_front()

void Isis::TargetBodyList::push_front ( TargetBodyQsp const & value)

Insertes a TargetBody at the front of the list.

Parameters
valueThe TargetBody to be prepend
See also
QList<TargetBodyQsp>::push_front()

References countChanged().

◆ removeAll()

int Isis::TargetBodyList::removeAll ( TargetBodyQsp const & value)

Removes all occurrences of a TargetBody and returns the number removed.

Parameters
valueThe TargetBody to be removed.
Returns
int The Number of TargetBodies removed.
See also
QList<TargetBodyQsp>::removeAll()

References countChanged().

◆ removeAt()

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

Removes the TargetBody at a specific index.

Parameters
iThe index of the TargetBody to be removed
See also
QList<TargetBodyQsp>::removeAt()

References countChanged().

◆ removeFirst()

void Isis::TargetBodyList::removeFirst ( )

Removes the first TargetBody from the list.

See also
QList<TargetBodyQsp>::removeFirst()

References countChanged().

◆ removeLast()

void Isis::TargetBodyList::removeLast ( )

Removes the last TargetBody from the list.

See also
QList<TargetBodyQsp>::removeLast()

References countChanged().

◆ removeOne()

bool Isis::TargetBodyList::removeOne ( TargetBodyQsp const & value)

Removes the first occurrence of a TargetBody from the list.

Parameters
valuethe TargetBody to be removed
Returns
bool If the removal was successful
See also
QList<TargetBodyQsp>::removeOne()

References countChanged().

◆ save()

void Isis::TargetBodyList::save ( QXmlStreamWriter & stream,
const Project * project,
FileName newProjectRoot ) const

Delete all of the contained TargetBody objects from disk (see TargetBody::deleteFromDisk())

Convert this target body list into XML format for saving/restoring capabilities.

This writes:

  <TargetBodyList name="..." path="...">

to the given xml stream, and creates a 'targets.xml' inside the folder with the target body objects. Inside the images.xml, this writes:

  <targets>
    ...
  </targets>
Parameters
streamThe QXmlStreamWriter that will be used to convert the TargetBodyList
projectThe Project the TargetBodyList belongs to
newProjectRootThe root of the project folder where the TargetBodyList will be saved

◆ setName()

void Isis::TargetBodyList::setName ( QString newName)

Gets a list of pre-connected actions that have to do with display, such as color, alpha, outline, fill, etc.

Returns true if all of the given displays support the property

Parameters
propThe property we're testing for support for
displaysThe displays we're doing the test on Set the human-readable name of this target body list. This is really only useful for project target body lists (not anonymous temporary ones).
newNameThe name to give this target body list

◆ setPath()

void Isis::TargetBodyList::setPath ( QString newPath)

Set the relative path (from the project root) to this target body list's folder.

This is really only useful for project target body lists (not anonymous temporary ones).

Parameters
newPathThe path to the target body objects in this target body list

◆ supportedActions()

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

◆ swap()

void Isis::TargetBodyList::swap ( QList< TargetBodyQsp > & other)

Swaps the list with another TargetBodyList.

Parameters
otherThe TargetBodyList to swap with
See also
QList<TargetBodyQsp>::swap()

References countChanged().

◆ takeAt()

TargetBodyQsp Isis::TargetBodyList::takeAt ( int i)

Removes and returns the TargetBody at a specific index.

Parameters
iThe index of the TargetBody to takeAt
Returns
TargetBodyQsp The removed TargetBody
See also
QList<TargetBodyQsp>::takeAt()

References countChanged().

◆ takeFirst()

TargetBodyQsp Isis::TargetBodyList::takeFirst ( )

Removes and returns the first TargetBody in the list.

Returns
TargetBodyQsp The first TargetBody in the list
See also
QList<TargetBodyQsp>::takeFirst()

References countChanged().

◆ takeLast()

TargetBodyQsp Isis::TargetBodyList::takeLast ( )

Removes and returns the last TargetBody in the list.

Returns
TargetBodyQsp The last TargetBody in the list.
See also
QList<TargetBodyQsp>::takeLast()

References countChanged().


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