Isis 3 Programmer 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

Classes

class  XmlHandler
 XmlReader for working with TargetBody XML files. More...
 

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

Private Attributes

QString m_name
 This functor is used for copying the TargetBody objects between two projects quickly.
 
QString m_path
 This stores the directory name that contains the TargetBody objects in this list.
 

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
History

2015-06-11 Ken Edmundson - original version

2016-06-17 Jesse Mapel - Updated documentation before merging from IPCE into ISIS. Fixes #4007.

Definition at line 33 of file TargetBodyList.h.

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

Definition at line 38 of file TargetBodyList.cpp.

References m_name, m_path, name(), and path().

Referenced by Isis::TargetBodyList::XmlHandler::XmlHandler().

◆ TargetBodyList() [2/5]

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

Create a blank target body list.

Parameters
parentThe Qt-relationship parent

Definition at line 49 of file TargetBodyList.cpp.

◆ 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

Definition at line 59 of file TargetBodyList.cpp.

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

Definition at line 71 of file TargetBodyList.cpp.

◆ TargetBodyList() [5/5]

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

Copy constructor.

Parameters
otherThe TargetBodyList to copy

Definition at line 82 of file TargetBodyList.cpp.

References m_name, and m_path.

◆ ~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.

Definition at line 108 of file TargetBodyList.cpp.

Member Function Documentation

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

Definition at line 132 of file TargetBodyList.cpp.

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

Definition at line 119 of file TargetBodyList.cpp.

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

◆ clear()

void Isis::TargetBodyList::clear ( )

clears the list.

See also
QList<TargetBodyQsp>::clear()

Definition at line 143 of file TargetBodyList.cpp.

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

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

Definition at line 178 of file TargetBodyList.cpp.

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

Definition at line 159 of file TargetBodyList.cpp.

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

Definition at line 193 of file TargetBodyList.cpp.

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

Definition at line 211 of file TargetBodyList.cpp.

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

Definition at line 671 of file TargetBodyList.cpp.

References m_name.

Referenced by Isis::TargetBodyList::XmlHandler::startElement(), and 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+=()

Definition at line 401 of file TargetBodyList.cpp.

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

Definition at line 421 of file TargetBodyList.cpp.

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

Definition at line 437 of file TargetBodyList.cpp.

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

Definition at line 457 of file TargetBodyList.cpp.

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

Definition at line 473 of file TargetBodyList.cpp.

◆ 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

Definition at line 492 of file TargetBodyList.cpp.

References m_name, and m_path.

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

Definition at line 683 of file TargetBodyList.cpp.

References m_path.

Referenced by Isis::TargetBodyList::XmlHandler::startElement(), and 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()

Definition at line 225 of file TargetBodyList.cpp.

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

Definition at line 238 of file TargetBodyList.cpp.

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

Definition at line 251 of file TargetBodyList.cpp.

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

Definition at line 266 of file TargetBodyList.cpp.

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

Definition at line 284 of file TargetBodyList.cpp.

◆ removeFirst()

void Isis::TargetBodyList::removeFirst ( )

Removes the first TargetBody from the list.

See also
QList<TargetBodyQsp>::removeFirst()

Definition at line 295 of file TargetBodyList.cpp.

◆ removeLast()

void Isis::TargetBodyList::removeLast ( )

Removes the last TargetBody from the list.

See also
QList<TargetBodyQsp>::removeLast()

Definition at line 306 of file TargetBodyList.cpp.

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

Definition at line 321 of file TargetBodyList.cpp.

◆ 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

Definition at line 726 of file TargetBodyList.cpp.

◆ 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

Definition at line 650 of file TargetBodyList.cpp.

References m_name.

◆ 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

Definition at line 661 of file TargetBodyList.cpp.

References m_path.

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

Definition at line 339 of file TargetBodyList.cpp.

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

Definition at line 357 of file TargetBodyList.cpp.

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

Definition at line 371 of file TargetBodyList.cpp.

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

Definition at line 385 of file TargetBodyList.cpp.

Member Data Documentation

◆ m_name

QString Isis::TargetBodyList::m_name
private

This functor is used for copying the TargetBody objects between two projects quickly.

This is designed to work with QtConcurrentMap, though the results are all NULL (QtConcurrentMap is much faster than many QtConcurrentRun calls).

Author
2015-06-11 Ken Edmundson (after Steven Lambright)

The display name of the TaregetBodyList

Definition at line 190 of file TargetBodyList.h.

Referenced by name(), operator=(), setName(), TargetBodyList(), and TargetBodyList().

◆ m_path

QString Isis::TargetBodyList::m_path
private

This stores the directory name that contains the TargetBody objects in this list.

For example: import1 or import2

This path is relative to Project::imageDataRoot()

Definition at line 202 of file TargetBodyList.h.

Referenced by operator=(), path(), setPath(), TargetBodyList(), and TargetBodyList().


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