Isis 3 Developer Reference
Isis::ControlList Class Reference

Maintains a list of Controls so that control nets can easily be copied from one Project to another, saved to disk, or deleted from disk. More...

#include <ControlList.h>

Inheritance diagram for Isis::ControlList:
Inheritance graph
Collaboration diagram for Isis::ControlList:
Collaboration graph

Signals

void countChanged (int newCount)
 
void deletingList (ControlList *list)
 

Public Member Functions

 ControlList (QString name, QString path, QObject *parent=NULL)
 Create an control list from a control list name and path (does not read Controls). More...
 
 ControlList (QObject *parent=NULL)
 Create a blank control list. More...
 
 ControlList (QList< Control *>, QObject *parent=NULL)
 Create an control list from a list of controls. More...
 
 ControlList (Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent=NULL)
 Create an control list from XML. More...
 
 ControlList (QStringList &)
 Create an control list from a list of control net file names. More...
 
 ControlList (const ControlList &)
 Copy constructor. More...
 
 ~ControlList ()
 Destructor. More...
 
void append (Control *const &value)
 Appends a control pointer to the control list. More...
 
void append (const QList< Control *> &value)
 Appends a list of control pointers to the control list. More...
 
void clear ()
 Clears the control list. More...
 
iterator erase (iterator pos)
 Erases a control pointer from the control list at the specified position. More...
 
iterator erase (iterator begin, iterator end)
 Erases all control pointers starting at "begin" up to (but not including) end. More...
 
void insert (int i, Control *const &value)
 Inserts a control pointer at the specified position in the control list. More...
 
iterator insert (iterator before, Control *const &value)
 Inserts a control pointer before the specified iterator position. More...
 
void prepend (Control *const &value)
 Prepends a control pointer to the control list. More...
 
void push_back (Control *const &value)
 Equivalent to append(value) More...
 
void push_front (Control *const &value)
 Equivalent to prepend(value) More...
 
int removeAll (Control *const &value)
 Removes all occurences of the control pointer in the control list. More...
 
void removeAt (int i)
 Removes the control pointer at the specified index. More...
 
void removeFirst ()
 Removes the first control pointer from the control list. More...
 
void removeLast ()
 Removes the last control pointer from the control list. More...
 
bool removeOne (Control *const &value)
 Removes the first occurence of the control pointer from the control list. More...
 
void swap (QList< Control *> &other)
 Swaps this control list's control pointers with the other list of control pointers. More...
 
ControltakeAt (int i)
 Remove the control pointer at the specified index and returns it. More...
 
ControltakeFirst ()
 Removes the first control pointer from the control list and returns it. More...
 
ControltakeLast ()
 Removes the last control pointer from the control list and returns it. More...
 
ControlListoperator+= (const QList< Control *> &other)
 Appends control pointers from the other list to this control list. More...
 
ControlListoperator+= (Control *const &other)
 Appends a control pointer to this control list. More...
 
ControlListoperator<< (const QList< Control *> &other)
 Appends a list of other control pointers to this control list. More...
 
ControlListoperator<< (Control *const &other)
 Appends a control pointer to this control list. More...
 
ControlListoperator= (const QList< Control *> &rhs)
 Assigns another list of control pointers to this control list. More...
 
ControlListoperator= (const ControlList &rhs)
 Assignment operator. More...
 
QList< QAction * > supportedActions (Project *project=NULL)
 
bool allSupport (ControlDisplayProperties::Property prop)
 
void setName (QString newName)
 Set the human-readable name of this control list. More...
 
void setPath (QString newPath)
 Set the relative path (from the project root) to this control list's folder. More...
 
QString name () const
 Get the human-readable name of this control list. More...
 
QString path () const
 Get the path to these controls in the control list (relative to project root). More...
 
void deleteFromDisk (Project *project)
 Delete all of the contained Controls from disk. More...
 
void save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
 Convert this control list into XML format for saving/restoring capabilities. More...
 

Detailed Description

Maintains a list of Controls so that control nets can easily be copied from one Project to another, saved to disk, or deleted from disk.

Overrides several common QList methods for managing a list of Controls as well. Adapted from ImageList

Author
2012-09-01 Tracie Sucharski

Constructor & Destructor Documentation

◆ ControlList() [1/6]

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

Create an control list from a control list name and path (does not read Controls).

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

References name(), and path().

◆ ControlList() [2/6]

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

Create a blank control list.

Parameters
parentThe Qt-relationship parent

◆ ControlList() [3/6]

Isis::ControlList::ControlList ( QList< Control *>  controls,
QObject parent = NULL 
)
explicit

Create an control list from a list of controls.

Parameters
controlsThe list of controls
parentThe Qt-relationship parent

References append().

◆ ControlList() [4/6]

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

Create an control list from XML.

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

References Isis::XmlStackedHandlerReader::pushContentHandler().

◆ ControlList() [5/6]

Isis::ControlList::ControlList ( QStringList fileNames)
explicit

Create an control list from a list of control net file names.

This is slow (serial) and not recommended.

Parameters
fileNamesControl net file names

References append().

◆ ControlList() [6/6]

Isis::ControlList::ControlList ( const ControlList other)

Copy constructor.

Parameters
otherThe ControlList to copy

◆ ~ControlList()

Isis::ControlList::~ControlList ( )

Destructor.

This does not free the Controls from memory.

References deletingList().

Member Function Documentation

◆ allSupport()

bool Isis::ControlList::allSupport ( ControlDisplayProperties::Property  prop)

◆ append() [1/2]

void Isis::ControlList::append ( Control *const &  value)

Appends a control pointer to the control list.

Parameters
valueThe control pointer to append
See also
QList<Control *>::append()

References countChanged().

Referenced by ControlList().

◆ append() [2/2]

void Isis::ControlList::append ( const QList< Control *> &  value)

Appends a list of control pointers to the control list.

Parameters
valueThe list of control pointers to append
See also
QList<Control *>::append()

References countChanged().

◆ clear()

void Isis::ControlList::clear ( )

Clears the control list.

See also
QList<Control *>::clear()

References countChanged().

◆ countChanged

◆ deleteFromDisk()

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

Delete all of the contained Controls from disk.

Parameters
projectProject to delete controls from
See also
Control::deleteFromDisk()

References Isis::Project::cnetRoot(), and Isis::Control::deleteFromDisk().

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

◆ deletingList

void Isis::ControlList::deletingList ( ControlList list)
signal

Referenced by ~ControlList().

◆ erase() [1/2]

QList< Control * >::iterator Isis::ControlList::erase ( iterator  pos)

Erases a control pointer from the control list at the specified position.

Parameters
posThe position to erase at
Returns
QList<Control *>::iterator Iterator to the next item in the list
See also
QList<Control *>::erase()

References countChanged().

◆ erase() [2/2]

QList< Control * >::iterator Isis::ControlList::erase ( iterator  begin,
iterator  end 
)

Erases all control pointers starting at "begin" up to (but not including) end.

Parameters
beginIterator to the first control pointer to erase from the list
endIterator to the end control pointer (which will not be erased)
Returns
QList<Control *>::iterator Iterator to the end control pointer
See also
QList<Control *>::erase()

References countChanged().

◆ insert() [1/2]

void Isis::ControlList::insert ( int  i,
Control *const &  value 
)

Inserts a control pointer at the specified position in the control list.

Parameters
iThe index to insert at
valueThe control pointer to insert
See also
QList<Control *>::insert()

References countChanged().

◆ insert() [2/2]

QList< Control * >::iterator Isis::ControlList::insert ( iterator  before,
Control *const &  value 
)

Inserts a control pointer before the specified iterator position.

Parameters
beforeIterator to the item to insert the control pointer before
valueThe control pointer to insert
Returns
QList<Control *>::iterator Iterator to the inserted control pointer
See also
QList<Control *>::insert()

References countChanged().

◆ name()

QString Isis::ControlList::name ( ) const

Get the human-readable name of this control list.

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

Referenced by ControlList(), Isis::Project::controlList(), Isis::ProjectItem::setControlList(), and Isis::ExportControlNetWorkOrder::setupExecution().

◆ operator+=() [1/2]

ControlList & Isis::ControlList::operator+= ( const QList< Control *> &  other)

Appends control pointers from the other list to this control list.

Parameters
Thelist of other control pointers to append
Returns
ControlList & Reference to this control list
See also
QList<Control *>::operator+=()

References countChanged().

◆ operator+=() [2/2]

ControlList & Isis::ControlList::operator+= ( Control *const &  other)

Appends a control pointer to this control list.

Parameters
otherThe control pointer to append
Returns
ControlList & Reference to this control list
See also
QList<Control *>::operator+=()

References countChanged().

◆ operator<<() [1/2]

ControlList & Isis::ControlList::operator<< ( const QList< Control *> &  other)

Appends a list of other control pointers to this control list.

Parameters
otherThe list of other control pointers to append
Returns
ControlList & Reference to this control list
See also
QList<Control *>::operator<<()

References operator<<().

◆ operator<<() [2/2]

ControlList & Isis::ControlList::operator<< ( Control *const &  other)

Appends a control pointer to this control list.

Parameters
otherThe control pointer to append
Returns
ControlList & Reference to this control list
See also
QList<Control *>::operator<<()

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

◆ operator=() [1/2]

ControlList & Isis::ControlList::operator= ( const QList< Control *> &  rhs)

Assigns another list of control pointers to this control list.

Parameters
rhsThe other list of control pointers to assign
Returns
ControlList & Reference to this control list
See also
QList<Control *>::operator=()

References countChanged().

◆ operator=() [2/2]

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

Assignment operator.

Parameters
rhsThe right hand side of the '=' operator
Returns
ControlList & Reference to this ControlList
See also
ControlList::operator=(const QList<Control *> &rhs)

References countChanged().

◆ path()

QString Isis::ControlList::path ( ) const

Get the path to these controls in the control list (relative to project root).

This only applies to a control list from the project.

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

Referenced by ControlList().

◆ prepend()

void Isis::ControlList::prepend ( Control *const &  value)

Prepends a control pointer to the control list.

Parameters
valueThe control pointer to prepend to the control list
See also
QList<Control *>::prepend()

References countChanged().

◆ push_back()

void Isis::ControlList::push_back ( Control *const &  value)

Equivalent to append(value)

Parameters
valueThe control pointer to append to the control list
See also
ControlList::append(Control * const &value)
QList<Control *>::push_back()

References countChanged().

◆ push_front()

void Isis::ControlList::push_front ( Control *const &  value)

Equivalent to prepend(value)

Parameters
valueThe control pointer to prepend to the control list
See also
ControlList::prepend(Control * const &value)
QList<Control *>::push_front()

References countChanged().

◆ removeAll()

int Isis::ControlList::removeAll ( Control *const &  value)

Removes all occurences of the control pointer in the control list.

Parameters
valueThe control pointer value to remove
Returns
int The number of control pointers removed
See also
QList<Control *>::removeAll()

References countChanged().

◆ removeAt()

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

Removes the control pointer at the specified index.

Parameters
iThe index of the control pointer to remove
See also
QList<Control *>::removeAt()

References countChanged().

◆ removeFirst()

void Isis::ControlList::removeFirst ( )

Removes the first control pointer from the control list.

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

References countChanged().

◆ removeLast()

void Isis::ControlList::removeLast ( )

Removes the last control pointer from the control list.

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

References countChanged().

◆ removeOne()

bool Isis::ControlList::removeOne ( Control *const &  value)

Removes the first occurence of the control pointer from the control list.

Parameters
valueThe control pointer to remove
Returns
bool True if a control pointer was removed; otherwise false
See also
QList<Control *>::removeOne()

References countChanged().

◆ save()

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

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

This writes:

  <controlList name="..." path="...">

to the given xml stream, and creates an 'controls.xml' inside the folder with the controls. Inside the controlNetworks.xml, this writes:

  <controls>
    ...
  </controls>
Parameters
streamXML stream that contains the control list data
projectProject to save control list from
newProjectRootFilename root to save control list to
Exceptions
IException::Io"Unable Failed to create directory"
IException::Io"Unable to save control information, could not be opened for writing"

References _FILEINFO_, Isis::Project::cnetRoot(), Isis::FileName::dir(), Isis::IException::Io, Isis::Project::newProjectRoot(), Isis::FileName::original(), Isis::FileName::path(), Isis::Project::projectRoot(), Isis::ReadWrite, Isis::Control::save(), and Isis::FileName::toString().

◆ setName()

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

Set the human-readable name of this control list.

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

Parameters
newNameThe name to give this control list

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

◆ setPath()

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

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

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

Parameters
newPathThe path to the controls in this control list

◆ supportedActions()

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

◆ swap()

void Isis::ControlList::swap ( QList< Control *> &  other)

Swaps this control list's control pointers with the other list of control pointers.

Parameters
otherThe list of control pointers to swap
See also
QList<Control *>::swap()

References countChanged().

◆ takeAt()

Control * Isis::ControlList::takeAt ( int  i)

Remove the control pointer at the specified index and returns it.

Parameters
iThe index of the control pointer to take
Returns
Contol * The removed control pointer
See also
QList<Control *>::takeAt()

References countChanged().

◆ takeFirst()

Control * Isis::ControlList::takeFirst ( )

Removes the first control pointer from the control list and returns it.

Returns
Control * The first control pointer in the control list
See also
QList<Control *>::takeFirst()

References countChanged().

◆ takeLast()

Control * Isis::ControlList::takeLast ( )

Removes the last control pointer from the control list and returns it.

Returns
Control * The last control pointer in the control list
See also
QList<Control *>::takeLast()

References countChanged().


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