|
Isis 3 Programmer Reference
|
17 #include <QXmlStreamWriter>
19 #include "ControlDisplayProperties.h"
20 #include "ControlNet.h"
22 #include "IException.h"
25 #include "PvlObject.h"
26 #include "XmlStackedHandlerReader.h"
54 m_id =
new QUuid(QUuid::createUuid());
76 m_id =
new QUuid(QUuid::createUuid());
100 m_id =
new QUuid(QUuid::createUuid());
243 m_modified = modified;
283 return m_id->toString().remove(QRegExp(
"[{}]"));
298 QString newNetworkPath = project->
cnetRoot(newProjectRoot.
toString()) +
"/" +
310 if (!QFile::copy(oldNetworkPath,newNetworkPath) ) {
338 tr(
"Could not remove file [%1]").arg(
m_fileName),
360 original.
dir().dirName() +
"/" + original.
name());
375 stream.writeStartElement(
"controlNet");
376 stream.writeAttribute(
"id",
m_id->toString());
382 stream.writeEndElement();
412 const QString &qName,
const QXmlAttributes &atts) {
413 if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) {
414 if (localName ==
"controlNet") {
415 QString
id = atts.value(
"id");
416 QString path = atts.value(
"path");
417 QString
fileName = atts.value(
"fileName");
420 delete m_xmlHandlerControl->m_id;
421 m_xmlHandlerControl->m_id = NULL;
422 m_xmlHandlerControl->m_id =
new QUuid(
id.toLatin1());
426 m_xmlHandlerControl->m_fileName = m_xmlHandlerCnetFolderName.expanded() +
"/" +
fileName;
429 else if (localName ==
"displayProperties") {
@ Io
A type of error that occurred when performing an actual I/O operation.
Control(QString cnetFileName, QObject *parent=0)
Create a Control from control net located on disk.
ControlDisplayProperties * m_displayProperties
Contains the display properties for this Control object.
void SetMutex(QMutex *mutex)
Set mutex to lock for making Naif calls.
XmlHandler(Control *control, FileName cnetFolder)
Constructor for the Control object's XmlHandler.
QMutex * mutex()
Return mutex used for Naif calls.
void deleteFromDisk()
Delete the control net from disk.
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
File name manipulation and expansion.
virtual void pushContentHandler(XmlStackedHandler *newHandler)
Push a contentHandler and maybe continue parsing...
void Write(const QString &filename, bool pvl=false)
Writes out the control network.
FileName m_xmlHandlerCnetFolderName
The name of the folder for the control xml.
static QString cnetRoot(QString projectRoot)
Appends the root directory name 'cnets' to the project.
Nested class used to write the Control object information to an XML file for the purpose of saving an...
This is the GUI communication mechanism for cubes.
This represents an ISIS control net in a project-based GUI interface.
QUuid * m_id
A unique ID for this Control.
void copyToNewProjectRoot(const Project *project, FileName newProjectRoot)
Copies the files of the given Project to the given location.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Manage a stack of content handlers for reading XML files.
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Method to write this Control object's member data to an XML stream.
bool isModified()
@description Has this control been modified?
~Control()
Destroys Control object.
The main project for ipce.
void closeControlNet()
Cleans up the ControlNet pointer.
bool write()
@description Write control net to disk.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
ControlNet * controlNet()
Open and return a pointer to the ControlNet for this Control.
QDir dir() const
Returns the path of the file's parent directory as a QDir object.
void openControlNet()
Sets the ControlNet from the control net file name provided in the constructor.
void setModified(bool modified=true)
@description Sets the modification state of this control.
Control * m_xmlHandlerControl
A pointer to the Control object to be read or written.
QString toString() const
Returns a QString of the full file name including the file path, excluding the attributes with any Is...
QString projectRoot() const
Get the top-level folder of the project.
void updateFileName(Project *)
Change the on-disk file name for this control to be where the control ought to be in the given projec...
ControlNet * m_controlNet
A pointer to the ControlNet object associated with this Control object.
@ Programmer
This error is for when a programmer made an API call that was illegal.
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Method to read the given XML formatted attribute for a Control object into the XmlHandler.
QString m_fileName
Project associated with this control.
ControlDisplayProperties * displayProperties()
Access a pointer to the display properties for the control network.
QString id() const
Access the unique ID associated with this Control.
This is free and unencumbered software released into the public domain.
QString fileName() const
Access the name of the control network file associated with this Control.