Isis 3.0 Programmer Reference
Back | Home
Isis::Control Class Reference

This represents an ISIS control net in a project-based GUI interface. More...

#include <Control.h>

Inheritance diagram for Isis::Control:
Inheritance graph
Collaboration diagram for Isis::Control:
Collaboration graph

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

Public Member Functions

 Control (QString cnetFileName, QObject *parent=0)
 Create a Control from control net located on disk. 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...
 
ControlNetcontrolNet ()
 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...
 
void closeControlNet ()
 Cleans up the ControlNet pointer. More...
 
ControlDisplayPropertiesdisplayProperties ()
 Access a pointer to the display properties for the control network. More...
 
const ControlDisplayPropertiesdisplayProperties () 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...
 
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...
 

Private Member Functions

 Control (const Control &other)
 
Controloperator= (const Control &rhs)
 

Private Attributes

ControlNetm_controlNet
 A pointer to the ControlNet object associated with this Control object. More...
 
ControlDisplayPropertiesm_displayProperties
 Contains the display properties for this Control object. More...
 
QString m_fileName
 File name of the control net associated with this control. More...
 
QUuid * m_id
 A unique ID for this Control. More...
 

Detailed Description

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.

Author
2012-06-12 Ken Edmundson and Tracie Sucharski
History:

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

Definition at line 57 of file Control.h.

Constructor & Destructor Documentation

Isis::Control::Control ( QString  cNetFileName,
QObject parent = 0 
)
explicit

Create a Control from control net located on disk.

Parameters
cNetFileNameThe name of the control net on disk
parentThe Qt-relationship parent

Definition at line 27 of file Control.cpp.

References m_controlNet, m_displayProperties, m_fileName, m_id, and openControlNet().

Isis::Control::Control ( ControlNet controlNet,
QString  cnetFileName,
QObject parent = 0 
)
explicit

Create a Control from a control network that has already been created and read from disk.

Parameters
controlNetThe actual control network
cnetFileNameThe name of the control net on disk
parentThe Qt-relationship parent

Definition at line 50 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.

Parameters
cnetFolderLocation of control xml
xmlReaderAn XML reader that's up to an <control> tag.
parentThe Qt-relationship parent

Definition at line 72 of file Control.cpp.

References m_controlNet, m_displayProperties, and m_id.

Isis::Control::~Control ( )

Destroys Control object.

Definition at line 85 of file Control.cpp.

References m_controlNet, m_displayProperties, and m_id.

Member Function Documentation

void Isis::Control::closeControlNet ( )

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 138 of file Control.cpp.

References m_controlNet.

Referenced by updateFileName().

void Isis::Control::copyToNewProjectRoot ( const Project project,
FileName  newProjectRoot 
)

Copies the files of the given Project to the given location.

Parameters
projectA pointer to the Project.
newProjectRootThe name of the new root directory where the project will be copied.

Definition at line 193 of file Control.cpp.

References Isis::Project::cnetRoot(), controlNet(), m_fileName, Isis::Project::projectRoot(), 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().

Exceptions
IException::Io"Could not remove file."

Definition at line 210 of file Control.cpp.

References _FILEINFO_, 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.

Returns
ControlDisplayProperties * A pointer to the display properties.

Definition at line 151 of file Control.cpp.

References m_displayProperties.

Referenced by Isis::Directory::addCnetEditorView(), and Isis::ExportControlNetWorkOrder::execute().

const ControlDisplayProperties * Isis::Control::displayProperties ( ) const

Access a const pointer to the display properties for the control network.

Returns
ControlDisplayProperties * A pointer to the display properties.

Definition at line 161 of file Control.cpp.

References m_displayProperties.

QString Isis::Control::fileName ( ) const

Access the name of the control network file associated with this Control.

Returns
QString The file name of the control network.

Definition at line 171 of file Control.cpp.

References m_fileName.

Referenced by Isis::Project::addControl(), Isis::BundleAdjust::BundleAdjust(), Isis::ExportControlNetWorkOrder::execute(), Isis::MosaicControlNetTool::openControlNet(), Isis::ControlPointEditWidget::setControl(), Isis::ProjectItem::setControl(), and Isis::Control::XmlHandler::startElement().

QString Isis::Control::id ( ) const

Access the unique ID associated with this Control.

Returns
QString The Control ID.

Definition at line 181 of file Control.cpp.

References m_id.

Referenced by Isis::Project::addControl(), and Isis::ExportControlNetWorkOrder::execute().

void Isis::Control::openControlNet ( )

Sets the ControlNet from the control net file name provided in the constructor.

Exceptions
IException::Programmer"Error opening control net."

Definition at line 121 of file Control.cpp.

References _FILEINFO_, m_controlNet, m_fileName, and Isis::IException::Programmer.

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.

Parameters
streamThe stream to which the Control will be saved.
projectThe Project to which this Control will be added.
newProjectRootThe location of the project root directory.

Definition at line 248 of file Control.cpp.

References m_displayProperties, m_fileName, and m_id.

Referenced by Isis::ControlList::save().

void Isis::Control::updateFileName ( Project project)
slot

Change the on-disk file name for this control to be where the control ought to be in the given project.

Parameters
projectThe project that this control is stored in

Definition at line 230 of file Control.cpp.

References closeControlNet(), Isis::Project::cnetRoot(), and m_fileName.

Member Data Documentation

ControlNet* Isis::Control::m_controlNet
private

A pointer to the ControlNet object associated with this Control object.

Definition at line 109 of file Control.h.

Referenced by closeControlNet(), Control(), controlNet(), openControlNet(), and ~Control().

ControlDisplayProperties* Isis::Control::m_displayProperties
private

Contains the display properties for this Control object.

Definition at line 111 of file Control.h.

Referenced by Control(), displayProperties(), save(), and ~Control().

QString Isis::Control::m_fileName
private

File name of the control net associated with this control.

Definition at line 113 of file Control.h.

Referenced by Control(), copyToNewProjectRoot(), deleteFromDisk(), fileName(), openControlNet(), save(), and updateFileName().

QUuid* Isis::Control::m_id
private

A unique ID for this Control.

(useful for others to reference this Control when saving to disk).

Definition at line 119 of file Control.h.

Referenced by Control(), id(), save(), and ~Control().


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

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 ISIS Support Center
File Modified: 07/12/2023 23:42:52