Isis 3 Programmer Reference
|
List for holding TargetBodies. More...
#include <TargetBodyList.h>
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). More... | |
TargetBodyList (QObject *parent=NULL) | |
Create a blank target body list. More... | |
TargetBodyList (QList< TargetBodyQsp >, QObject *parent=NULL) | |
Create a target body list from a list of TargetBody's. More... | |
TargetBodyList (Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent=NULL) | |
Create an image list from XML. More... | |
TargetBodyList (const TargetBodyList &) | |
Copy constructor. More... | |
~TargetBodyList () | |
Create an target body list from a list of target body file names. More... | |
void | append (TargetBodyQsp const &value) |
Appends a TargetBody to the list. More... | |
void | append (const QList< TargetBodyQsp > &value) |
Appends a TargetBodyList to the list. More... | |
void | clear () |
clears the list. More... | |
iterator | erase (iterator pos) |
Erases the TargetBody associated with an iterator. More... | |
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. More... | |
void | insert (int i, TargetBodyQsp const &value) |
Inserts a TargetBody at a specific index. More... | |
iterator | insert (iterator before, TargetBodyQsp const &value) |
Inserts a TargetBody after the TargetBody associated with an iterator. More... | |
void | prepend (TargetBodyQsp const &value) |
Inserts a TargetBody at the front of the list. More... | |
void | push_back (TargetBodyQsp const &value) |
Appends a TargetBody to the end of the list. More... | |
void | push_front (TargetBodyQsp const &value) |
Insertes a TargetBody at the front of the list. More... | |
int | removeAll (TargetBodyQsp const &value) |
Removes all occurrences of a TargetBody and returns the number removed. More... | |
void | removeAt (int i) |
Removes the TargetBody at a specific index. More... | |
void | removeFirst () |
Removes the first TargetBody from the list. More... | |
void | removeLast () |
Removes the last TargetBody from the list. More... | |
bool | removeOne (TargetBodyQsp const &value) |
Removes the first occurrence of a TargetBody from the list. More... | |
void | swap (QList< TargetBodyQsp > &other) |
Swaps the list with another TargetBodyList. More... | |
TargetBodyQsp | takeAt (int i) |
Removes and returns the TargetBody at a specific index. More... | |
TargetBodyQsp | takeFirst () |
Removes and returns the first TargetBody in the list. More... | |
TargetBodyQsp | takeLast () |
Removes and returns the last TargetBody in the list. More... | |
TargetBodyList & | operator+= (const QList< TargetBodyQsp > &other) |
Appends another TargetBodyList to the list. More... | |
TargetBodyList & | operator+= (TargetBodyQsp const &other) |
Appends a TargetBody to the list. More... | |
TargetBodyList & | operator<< (const QList< TargetBodyQsp > &other) |
Appends another TargetBodyList to the list. More... | |
TargetBodyList & | operator<< (TargetBodyQsp const &other) |
Appends a TargetBody to the list. More... | |
TargetBodyList & | operator= (const QList< TargetBodyQsp > &rhs) |
Assignment operator for a QList of TargetBodyQsp. More... | |
TargetBodyList & | operator= (const TargetBodyList &rhs) |
Assignment operator. More... | |
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. More... | |
void | setPath (QString newPath) |
Set the relative path (from the project root) to this target body list's folder. More... | |
QString | name () const |
Get the human-readable name of this target body list. More... | |
QString | path () const |
Get the path to these target body objects in the list (relative to project root). More... | |
void | save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const |
Delete all of the contained TargetBody objects from disk (see TargetBody::deleteFromDisk()) More... | |
Private Attributes | |
QString | m_name |
This functor is used for copying the TargetBody objects between two projects quickly. More... | |
QString | m_path |
This stores the directory name that contains the TargetBody objects in this list. More... | |
List for holding TargetBodies.
Overrides several QList methods in order to emit signals about the list changing. TargetBodies are stored as QSharedPointer<TargetBody>.
Definition at line 33 of file TargetBodyList.h.
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).
name | The TargetBodyList's name (i.e. import1, import2, ...) |
path | The TargetBodyList's folder name (i.e. import1, import2, ...) |
parent | The 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().
|
explicit |
Create a blank target body list.
parent | The Qt-relationship parent |
Definition at line 49 of file TargetBodyList.cpp.
|
explicit |
Create a target body list from a list of TargetBody's.
targetBodys | The list of targetBody's |
parent | The Qt-relationship parent |
Definition at line 59 of file TargetBodyList.cpp.
References append().
|
explicit |
Create an image list from XML.
project | The project with the target body list |
xmlReader | The XML reader currently at an <TargetBodyList > tag. |
parent | The Qt-relationship parent |
Definition at line 71 of file TargetBodyList.cpp.
References Isis::XmlStackedHandlerReader::pushContentHandler().
Isis::TargetBodyList::TargetBodyList | ( | const TargetBodyList & | other | ) |
Copy constructor.
other | The TargetBodyList to copy |
Definition at line 82 of file TargetBodyList.cpp.
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.
void Isis::TargetBodyList::append | ( | const QList< TargetBodyQsp > & | value | ) |
Appends a TargetBodyList to the list.
value | the TargetBodyList to append |
Definition at line 132 of file TargetBodyList.cpp.
void Isis::TargetBodyList::append | ( | TargetBodyQsp const & | value | ) |
Appends a TargetBody to the list.
value | The TargetBody to append |
Definition at line 119 of file TargetBodyList.cpp.
Referenced by Isis::Project::addTarget(), and TargetBodyList().
void Isis::TargetBodyList::clear | ( | ) |
clears the list.
Definition at line 143 of file TargetBodyList.cpp.
Referenced by Isis::Project::clear().
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.
begin | An iterator associated with the first TargetBody to be erased. |
end | An iterator associated with the TargetBody after the last TargetBody to be erased |
Definition at line 178 of file TargetBodyList.cpp.
QList< TargetBodyQsp >::iterator Isis::TargetBodyList::erase | ( | iterator | pos | ) |
Erases the TargetBody associated with an iterator.
pos | An iterator associated with the TaretBody to be erased |
Definition at line 159 of file TargetBodyList.cpp.
void Isis::TargetBodyList::insert | ( | int | i, |
TargetBodyQsp const & | value | ||
) |
Inserts a TargetBody at a specific index.
i | The index at which to insert the TargetBody |
value | The TargetBody to insert |
Definition at line 193 of file TargetBodyList.cpp.
QList< TargetBodyQsp >::iterator Isis::TargetBodyList::insert | ( | iterator | before, |
TargetBodyQsp const & | value | ||
) |
Inserts a TargetBody after the TargetBody associated with an iterator.
before | An iterator associated with the TargetBody that will be before the inserted TargetBody |
value | The TargetBody to be inserted |
Definition at line 211 of file TargetBodyList.cpp.
QString Isis::TargetBodyList::name | ( | ) | const |
Get the human-readable name of this target body list.
Definition at line 671 of file TargetBodyList.cpp.
References m_name.
Referenced by Isis::ProjectItemModel::onTargetsAdded(), Isis::TargetBodyList::XmlHandler::startElement(), and TargetBodyList().
TargetBodyList & Isis::TargetBodyList::operator+= | ( | const QList< TargetBodyQsp > & | other | ) |
Appends another TargetBodyList to the list.
other | The TargetBodyList to be appended |
Definition at line 401 of file TargetBodyList.cpp.
TargetBodyList & Isis::TargetBodyList::operator+= | ( | TargetBodyQsp const & | other | ) |
Appends a TargetBody to the list.
other | The TargetBody to be appended |
Definition at line 421 of file TargetBodyList.cpp.
TargetBodyList & Isis::TargetBodyList::operator<< | ( | const QList< TargetBodyQsp > & | other | ) |
Appends another TargetBodyList to the list.
other | The TargetBodyList to be appended |
Definition at line 437 of file TargetBodyList.cpp.
TargetBodyList & Isis::TargetBodyList::operator<< | ( | TargetBodyQsp const & | other | ) |
Appends a TargetBody to the list.
other | The TargetBody to be appended |
Definition at line 457 of file TargetBodyList.cpp.
TargetBodyList & Isis::TargetBodyList::operator= | ( | const QList< TargetBodyQsp > & | rhs | ) |
Assignment operator for a QList of TargetBodyQsp.
rhs | The right hand side of the '=' operator |
Definition at line 473 of file TargetBodyList.cpp.
TargetBodyList & Isis::TargetBodyList::operator= | ( | const TargetBodyList & | rhs | ) |
Assignment operator.
rhs | The right hand side of the '=' operator |
Definition at line 492 of file TargetBodyList.cpp.
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.
Definition at line 683 of file TargetBodyList.cpp.
References m_path.
Referenced by Isis::TargetBodyList::XmlHandler::startElement(), and TargetBodyList().
void Isis::TargetBodyList::prepend | ( | TargetBodyQsp const & | value | ) |
Inserts a TargetBody at the front of the list.
value | the TargetBody to be inserted |
Definition at line 225 of file TargetBodyList.cpp.
void Isis::TargetBodyList::push_back | ( | TargetBodyQsp const & | value | ) |
Appends a TargetBody to the end of the list.
value | The TargetBody to be append |
Definition at line 238 of file TargetBodyList.cpp.
void Isis::TargetBodyList::push_front | ( | TargetBodyQsp const & | value | ) |
Insertes a TargetBody at the front of the list.
value | The TargetBody to be prepend |
Definition at line 251 of file TargetBodyList.cpp.
int Isis::TargetBodyList::removeAll | ( | TargetBodyQsp const & | value | ) |
Removes all occurrences of a TargetBody and returns the number removed.
value | The TargetBody to be removed. |
Definition at line 266 of file TargetBodyList.cpp.
void Isis::TargetBodyList::removeAt | ( | int | i | ) |
Removes the TargetBody at a specific index.
i | The index of the TargetBody to be removed |
Definition at line 284 of file TargetBodyList.cpp.
void Isis::TargetBodyList::removeFirst | ( | ) |
Removes the first TargetBody from the list.
Definition at line 295 of file TargetBodyList.cpp.
void Isis::TargetBodyList::removeLast | ( | ) |
Removes the last TargetBody from the list.
Definition at line 306 of file TargetBodyList.cpp.
bool Isis::TargetBodyList::removeOne | ( | TargetBodyQsp const & | value | ) |
Removes the first occurrence of a TargetBody from the list.
value | the TargetBody to be removed |
Definition at line 321 of file TargetBodyList.cpp.
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>
stream | The QXmlStreamWriter that will be used to convert the TargetBodyList |
project | The Project the TargetBodyList belongs to |
newProjectRoot | The root of the project folder where the TargetBodyList will be saved |
Definition at line 726 of file TargetBodyList.cpp.
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
prop | The property we're testing for support for |
displays | The 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). |
newName | The name to give this target body list |
Definition at line 650 of file TargetBodyList.cpp.
References m_name.
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).
newPath | The path to the target body objects in this target body list |
Definition at line 661 of file TargetBodyList.cpp.
References m_path.
void Isis::TargetBodyList::swap | ( | QList< TargetBodyQsp > & | other | ) |
Swaps the list with another TargetBodyList.
other | The TargetBodyList to swap with |
Definition at line 339 of file TargetBodyList.cpp.
TargetBodyQsp Isis::TargetBodyList::takeAt | ( | int | i | ) |
Removes and returns the TargetBody at a specific index.
i | The index of the TargetBody to takeAt |
Definition at line 357 of file TargetBodyList.cpp.
TargetBodyQsp Isis::TargetBodyList::takeFirst | ( | ) |
Removes and returns the first TargetBody in the list.
Definition at line 371 of file TargetBodyList.cpp.
TargetBodyQsp Isis::TargetBodyList::takeLast | ( | ) |
Removes and returns the last TargetBody in the list.
Definition at line 385 of file TargetBodyList.cpp.
|
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).
The display name of the TaregetBodyList
Definition at line 190 of file TargetBodyList.h.
Referenced by name(), operator=(), setName(), and TargetBodyList().
|
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(), and TargetBodyList().