This represents an ISIS control net in a project-based GUI interface. More...
#include <Control.h>


Public Slots | |
| void | updateFileName (Project *) |
| Change the on-disk file name for this control to be where the control ought to be in the given project. | |
| void | closeControlNet () |
| Cleans up the ControlNet pointer. | |
Public Member Functions | |
| Control (QString cnetFileName, QObject *parent=0) | |
| Create a Control from control net located on disk. | |
| Control (Project *project, QString cnetFileName, QObject *parent=0) | |
| Create a Control from control net located on disk associated with a Project. | |
| Control (ControlNet *controlNet, QString cnetFileName, QObject *parent=0) | |
| Create a Control from a control network that has already been created and read from disk. | |
| ~Control () | |
| Destroys Control object. | |
| ControlNet * | controlNet () |
| Open and return a pointer to the ControlNet for this Control. | |
| void | openControlNet () |
| Sets the ControlNet from the control net file name provided in the constructor. | |
| ControlDisplayProperties * | displayProperties () |
| Access a pointer to the display properties for the control network. | |
| const ControlDisplayProperties * | displayProperties () const |
| Access a const pointer to the display properties for the control network. | |
| QString | fileName () const |
| Access the name of the control network file associated with this Control. | |
| QString | id () const |
| Access the unique ID associated with this Control. | |
| bool | isModified () |
| @description Has this control been modified? | |
| void | setModified (bool modified=true) |
| @description Sets the modification state of this control. | |
| bool | write () |
| @description Write control net to disk. | |
| void | save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const |
| Method to write this Control object's member data to an XML stream. | |
| void | copyToNewProjectRoot (const Project *project, FileName newProjectRoot) |
| Copies the files of the given Project to the given location. | |
| void | deleteFromDisk () |
| Delete the control net from disk. | |
Public Attributes | |
| ControlNet * | m_controlNet |
| A pointer to the ControlNet object associated with this Control object. | |
Private Member Functions | |
| Control (const Control &other) | |
| Control & | operator= (const Control &rhs) |
Private Attributes | |
| bool | m_modified |
| ControlDisplayProperties * | m_displayProperties |
| Contains the display properties for this Control object. | |
| Project * | m_project |
| QString | m_fileName |
| Project associated with this control. | |
| QUuid * | m_id |
| A unique ID for this Control. | |
This represents an ISIS control net in a project-based GUI interface.
This encapsulates ideas about a control net such as it's filename and display properties.
2012-08-02 Kimberly Oyama - Added comments to some of the methods and member variables.
2012-09-11 Tracie Sucharski - Added new constructor that takes a ControlNet *.
2015-10-14 Jeffrey Covington - Declared Control * as a Qt metatype for use with QVariant. References #3949
2016-06-02 Jeannie Backer - Updated documentation. Fixes #3949
2017-08-02 Cole Neuabuer - Added new constructor. This constructor takes a Project and a filename of a controlnet. This was added because the Control object needs to assign a mutex when the control net is opened and by doing this internally we can Close control nets and not have to track whether this step has happened Fixes #5026
2017-08-11 Cole Neuabuer - Added try catch throw to make it so importing an invalid control net throws some type of error/warning Fixes #5064
2017-11-09 Tyler Wilson - Modified the copyToNewProjectRoot function so that the control net is copied to it's new location like a binary file, instead of being recreated from scratch by calling it's write method. Fixes #5212.
2017-12-20 Tracie Sucharski - In copyToNewProjectRoot use string comparison to compare project roots. References #4804, #4849.
2018-01-19 Tracie Sucharski - Do not copy control unless the project root has changed. References #5212.
2018-03-30 Tracie Sucharski - Added setModified and is Modified methods to keep track of the modification state of the control net. Add write method to write the control net to disk. This write method should be called by ipce classes instead of calling the ControlNet::Write directly so that control knows the state of the control net. If a project is performing a "Save As", and there is a modified active control,the cnet is written out to the new location, it is not save in the old project location.
|
explicit |
Create a Control from control net located on disk.
| cNetFileName | The name of the control net on disk |
| parent | The Qt-relationship parent |
Definition at line 35 of file Control.cpp.
References m_controlNet, m_displayProperties, m_fileName, m_id, and openControlNet().
Create a Control from control net located on disk associated with a Project.
| cNetFileName | The name of the control net on disk |
| parent | The Qt-relationship parent |
Definition at line 64 of file Control.cpp.
References m_controlNet, m_displayProperties, m_fileName, and m_id.
|
explicit |
Create a Control from a control network that has already been created and read from disk.
| controlNet | The actual control network |
| cnetFileName | The name of the control net on disk |
| parent | The Qt-relationship parent |
Definition at line 87 of file Control.cpp.
References controlNet(), m_controlNet, m_displayProperties, m_fileName, and m_id.
| Isis::Control::~Control | ( | ) |
Destroys Control object.
Definition at line 107 of file Control.cpp.
References m_controlNet, m_displayProperties, and m_id.
|
slot |
Cleans up the ControlNet pointer.
This method should be called once there is no more need for this network because the OS will limit how many of these can be open.
Definition at line 195 of file Control.cpp.
References m_controlNet.
Referenced by Isis::Directory::cleanupCnetEditorViewWidgets(), Isis::ImportControlNetWorkOrder::CreateControlsFunctor::operator()(), and updateFileName().
| ControlNet * Isis::Control::controlNet | ( | ) |
Open and return a pointer to the ControlNet for this Control.
Definition at line 131 of file Control.cpp.
References m_controlNet, and openControlNet().
Referenced by Control(), copyToNewProjectRoot(), Isis::Project::setActiveImageList(), and Isis::ControlPointEditWidget::setControl().
| void Isis::Control::copyToNewProjectRoot | ( | const Project * | project, |
| FileName | newProjectRoot ) |
Copies the files of the given Project to the given location.
| project | A pointer to the Project. |
| newProjectRoot | The name of the new root directory where the project will be copied. |
Definition at line 275 of file Control.cpp.
References Isis::Project::cnetRoot(), controlNet(), isModified(), m_fileName, Isis::Project::projectRoot(), setModified(), Isis::toString(), Isis::ControlNet::Write(), and write().
Referenced by Isis::ControlList::CopyControlDataFunctor::operator()().
| void Isis::Control::deleteFromDisk | ( | ) |
Delete the control net from disk.
The control net will no longer be accessible until you call updateFileName().
| IException::Io | "Could not remove file." |
Definition at line 315 of file Control.cpp.
References m_fileName.
Referenced by Isis::ControlList::deleteFromDisk().
| ControlDisplayProperties * Isis::Control::displayProperties | ( | ) |
Access a pointer to the display properties for the control network.
Definition at line 233 of file Control.cpp.
References m_displayProperties.
Referenced by Isis::Directory::addCnetEditorView(), and Isis::ExportControlNetWorkOrder::setupExecution().
| const ControlDisplayProperties * Isis::Control::displayProperties | ( | ) | const |
Access a const pointer to the display properties for the control network.
Definition at line 243 of file Control.cpp.
References m_displayProperties.
| QString Isis::Control::fileName | ( | ) | const |
Access the name of the control network file associated with this Control.
Definition at line 253 of file Control.cpp.
References m_fileName.
Referenced by Isis::BundleAdjust::BundleAdjust(), Isis::BundleAdjust::BundleAdjust(), Isis::ExportControlNetWorkOrder::execute(), Isis::JigsawRunWidget::JigsawRunWidget(), Isis::ControlPointEditWidget::setControl(), Isis::ExportControlNetWorkOrder::setupExecution(), and write().
| QString Isis::Control::id | ( | ) | const |
Access the unique ID associated with this Control.
Definition at line 263 of file Control.cpp.
References m_id.
Referenced by Isis::ProjectItemModel::onControlAdded(), and Isis::ExportControlNetWorkOrder::setupExecution().
| bool Isis::Control::isModified | ( | ) |
@description Has this control been modified?
Definition at line 210 of file Control.cpp.
Referenced by copyToNewProjectRoot().
| void Isis::Control::openControlNet | ( | ) |
Sets the ControlNet from the control net file name provided in the constructor.
| IException::Programmer | "Error opening control net." |
Definition at line 146 of file Control.cpp.
References m_controlNet, and m_fileName.
Referenced by Control(), and controlNet().
| void Isis::Control::save | ( | QXmlStreamWriter & | stream, |
| const Project * | project, | ||
| FileName | newProjectRoot ) const |
Method to write this Control object's member data to an XML stream.
| stream | The stream to which the Control will be saved. |
| project | The Project to which this Control will be added. |
| newProjectRoot | The location of the project root directory. |
Definition at line 354 of file Control.cpp.
References m_displayProperties, m_fileName, and m_id.
Referenced by Isis::ControlList::save().
| void Isis::Control::setModified | ( | bool | modified = true | ) |
@description Sets the modification state of this control.
This is needed for now since many classes make changes to the control net contained in this object, but the control does not know the state of the control net. TODO: Change this class to always know the state of the control Net.
Definition at line 222 of file Control.cpp.
Referenced by copyToNewProjectRoot().
|
slot |
Change the on-disk file name for this control to be where the control ought to be in the given project.
| project | The project that this control is stored in |
Definition at line 336 of file Control.cpp.
References closeControlNet(), Isis::Project::cnetRoot(), and m_fileName.
| bool Isis::Control::write | ( | ) |
@description Write control net to disk.
This method is used instead of calling ControlNet::Write directly so that Control knows the modification state of the control net. Note that if there is not a control net opened, there should no be any changes to write.
| IException::Programmer | "Cannot write control net to disk" |
Definition at line 172 of file Control.cpp.
References fileName(), and m_controlNet.
Referenced by copyToNewProjectRoot().
| ControlNet* Isis::Control::m_controlNet |
A pointer to the ControlNet object associated with this Control object.
Definition at line 68 of file Control.h.
Referenced by closeControlNet(), Control(), Control(), Control(), controlNet(), openControlNet(), write(), and ~Control().
|
private |
Contains the display properties for this Control object.
Definition at line 101 of file Control.h.
Referenced by Control(), Control(), Control(), displayProperties(), displayProperties(), save(), and ~Control().
|
private |
Project associated with this control.
File name of the control net associated with this control.
Definition at line 104 of file Control.h.
Referenced by Control(), Control(), Control(), copyToNewProjectRoot(), deleteFromDisk(), fileName(), openControlNet(), save(), and updateFileName().
|
private |