![]() |
Isis 3 Programmer Reference
|
This represents an ISIS control net in a project-based GUI interface. More...
#include <Control.h>
Classes | |
class | XmlHandler |
Nested class used to write the Control object information to an XML file for the purpose of saving and restoring the state of the project. More... | |
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. More... | |
void | closeControlNet () |
Cleans up the ControlNet pointer. More... | |
Public Member Functions | |
Control (QString cnetFileName, QObject *parent=0) | |
Create a Control from control net located on disk. More... | |
Control (Project *project, QString cnetFileName, QObject *parent=0) | |
Create a Control from control net located on disk associated with a Project. More... | |
Control (ControlNet *controlNet, QString cnetFileName, QObject *parent=0) | |
Create a Control from a control network that has already been created and read from disk. More... | |
Control (FileName cnetFolder, XmlStackedHandlerReader *xmlReader, QObject *parent=0) | |
Construct this control from XML. More... | |
~Control () | |
Destroys Control object. More... | |
ControlNet * | controlNet () |
Open and return a pointer to the ControlNet for this Control. More... | |
void | openControlNet () |
Sets the ControlNet from the control net file name provided in the constructor. More... | |
ControlDisplayProperties * | displayProperties () |
Access a pointer to the display properties for the control network. More... | |
const ControlDisplayProperties * | displayProperties () const |
Access a const pointer to the display properties for the control network. More... | |
QString | fileName () const |
Access the name of the control network file associated with this Control. More... | |
QString | id () const |
Access the unique ID associated with this Control. More... | |
bool | isModified () |
@description Has this control been modified? More... | |
void | setModified (bool modified=true) |
@description Sets the modification state of this control. More... | |
bool | write () |
@description Write control net to disk. More... | |
void | save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const |
Method to write this Control object's member data to an XML stream. More... | |
void | copyToNewProjectRoot (const Project *project, FileName newProjectRoot) |
Copies the files of the given Project to the given location. More... | |
void | deleteFromDisk () |
Delete the control net from disk. More... | |
Public Attributes | |
ControlNet * | m_controlNet |
A pointer to the ControlNet object associated with this Control object. More... | |
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. More... | |
Project * | m_project |
QString | m_fileName |
Project associated with this control. More... | |
QUuid * | m_id |
A unique ID for this Control. More... | |
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.
|
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, openControlNet(), and Isis::IException::Programmer.
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 | ( | FileName | cnetFolder, |
XmlStackedHandlerReader * | xmlReader, | ||
QObject * | parent = 0 |
||
) |
Construct this control from XML.
cnetFolder | Location of control xml |
xmlReader | An XML reader that's up to an <control> tag. |
parent | The Qt-relationship parent |
Definition at line 111 of file Control.cpp.
References m_controlNet, m_displayProperties, m_id, and Isis::XmlStackedHandlerReader::pushContentHandler().
Isis::Control::~Control | ( | ) |
Destroys Control object.
Definition at line 126 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 214 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 150 of file Control.cpp.
References m_controlNet, and openControlNet().
Referenced by Isis::CnetEditorWidget::control(), Control(), Isis::ControlHealthMonitorView::ControlHealthMonitorView(), copyToNewProjectRoot(), Isis::CnetEditorWidget::createConnectionTreeView(), Isis::CnetEditorWidget::createPointTreeView(), Isis::CnetEditorWidget::createSerialTreeView(), Isis::CnetEditorWidget::filteredNetwork(), Isis::MosaicControlNetTool::loadNetwork(), Isis::Project::setActiveImageList(), and Isis::ControlPointEditWidget::setControl().
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 294 of file Control.cpp.
References Isis::Project::cnetRoot(), controlNet(), Isis::FileName::dir(), Isis::IException::Io, isModified(), m_fileName, Isis::FileName::name(), Isis::Project::projectRoot(), setModified(), Isis::FileName::toString(), Isis::toString(), write(), and Isis::ControlNet::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 334 of file Control.cpp.
References Isis::IException::Io, and 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 252 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 262 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 272 of file Control.cpp.
References m_fileName.
Referenced by Isis::Project::addControl(), Isis::BundleAdjust::BundleAdjust(), Isis::ExportControlNetWorkOrder::execute(), Isis::JigsawRunWidget::JigsawRunWidget(), Isis::MosaicControlNetTool::openControlNet(), Isis::BundleSolutionInfo::outputControlNetFileName(), Isis::BundleSolutionInfo::save(), Isis::ControlPointEditWidget::setControl(), Isis::ProjectItem::setControl(), Isis::ExportControlNetWorkOrder::setupExecution(), Isis::Control::XmlHandler::startElement(), Isis::BundleSolutionInfo::updateFileName(), and write().
QString Isis::Control::id | ( | ) | const |
Access the unique ID associated with this Control.
Definition at line 282 of file Control.cpp.
References m_id.
Referenced by Isis::Project::addControl(), Isis::ProjectItemModel::onControlAdded(), and Isis::ExportControlNetWorkOrder::setupExecution().
bool Isis::Control::isModified | ( | ) |
@description Has this control been modified?
Definition at line 229 of file Control.cpp.
Referenced by copyToNewProjectRoot(), and Isis::Project::save().
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 165 of file Control.cpp.
References m_controlNet, m_fileName, Isis::Project::mutex(), Isis::IException::Programmer, and Isis::ControlNet::SetMutex().
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 373 of file Control.cpp.
References m_displayProperties, m_fileName, and m_id.
Referenced by Isis::BundleSolutionInfo::save(), and 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 241 of file Control.cpp.
Referenced by copyToNewProjectRoot(), and Isis::CnetEditorWidget::setCnetModified().
|
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 355 of file Control.cpp.
References closeControlNet(), Isis::Project::cnetRoot(), Isis::FileName::dir(), Isis::FileName::expanded(), m_fileName, and Isis::FileName::name().
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 191 of file Control.cpp.
References fileName(), m_controlNet, Isis::IException::Programmer, and Isis::ControlNet::Write().
Referenced by copyToNewProjectRoot(), and Isis::Project::save().
ControlNet* Isis::Control::m_controlNet |
A pointer to the ControlNet object associated with this Control object.
Definition at line 69 of file Control.h.
Referenced by closeControlNet(), Control(), controlNet(), openControlNet(), write(), and ~Control().
|
private |
Contains the display properties for this Control object.
Definition at line 127 of file Control.h.
Referenced by Control(), displayProperties(), save(), and ~Control().
|
private |
Project associated with this control.
File name of the control net associated with this control.
Definition at line 130 of file Control.h.
Referenced by Control(), copyToNewProjectRoot(), deleteFromDisk(), fileName(), openControlNet(), save(), and updateFileName().
|
private |
U.S. Department of the Interior | U.S. Geological Survey ISIS | Privacy & Disclaimers | Astrogeology Research Program To contact us, please post comments and questions on the USGS Astrogeology Discussion Board To report a bug, or suggest a feature go to: ISIS Github File Modified: 07/13/2023 15:18:26 |