Isis 3 Programmer Reference
Control.h
1#ifndef Control_H
2#define Control_H
3
10/* SPDX-License-Identifier: CC0-1.0 */
11
12#include <QObject> // parent
13#include <QString>
14
15#include "FileName.h"
16#include "XmlStackedHandler.h"
17
18class QMutex;
19class QUuid;
20class QXmlStreamWriter;
21
22namespace Isis {
23 class ControlDisplayProperties;
24 class ControlNet;
25 class FileName;
26 class Project;
27 class PvlObject;
28
66 class Control : public QObject {
67 Q_OBJECT
68 public:
71 explicit Control(QString cnetFileName, QObject *parent = 0);
72 explicit Control(Project *project, QString cnetFileName, QObject *parent = 0);
73 explicit Control(ControlNet *controlNet, QString cnetFileName, QObject *parent = 0);
74 Control(FileName cnetFolder, XmlStackedHandlerReader *xmlReader, QObject *parent = 0);
75 ~Control();
76
78 void openControlNet();
81 QString fileName() const;
82
83 QString id() const;
84
85 bool isModified();
86 void setModified(bool modified = true);
87 bool write();
88
89 void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
90 void copyToNewProjectRoot(const Project *project, FileName newProjectRoot);
91 void deleteFromDisk();
92
93 public slots:
94 void updateFileName(Project *);
95 void closeControlNet();
96
97 private:
107 public:
108 XmlHandler(Control *control, FileName cnetFolder);
109
110 virtual bool startElement(const QString &namespaceURI, const QString &localName,
111 const QString &qName, const QXmlAttributes &atts);
112
113 private:
114 Q_DISABLE_COPY(XmlHandler);
115
119 };
120
121 private:
122 Control(const Control &other);
123 Control &operator=(const Control &rhs);
124
125 bool m_modified;
126
129 Project *m_project;
130 QString m_fileName;
136 QUuid *m_id;
137 };
138}
139
140Q_DECLARE_METATYPE(Isis::Control *);
141
142#endif // Control_H
Nested class used to write the Control object information to an XML file for the purpose of saving an...
Definition Control.h:106
FileName m_xmlHandlerCnetFolderName
The name of the folder for the control xml.
Definition Control.h:118
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.
Definition Control.cpp:411
Control * m_xmlHandlerControl
A pointer to the Control object to be read or written.
Definition Control.h:116
XmlHandler(Control *control, FileName cnetFolder)
Constructor for the Control object's XmlHandler.
Definition Control.cpp:393
This is the GUI communication mechanism for cubes.
This represents an ISIS control net in a project-based GUI interface.
Definition Control.h:66
QString id() const
Access the unique ID associated with this Control.
Definition Control.cpp:282
ControlNet * controlNet()
Open and return a pointer to the ControlNet for this Control.
Definition Control.cpp:150
ControlDisplayProperties * displayProperties()
Access a pointer to the display properties for the control network.
Definition Control.cpp:252
QString m_fileName
Project associated with this control.
Definition Control.h:130
void deleteFromDisk()
Delete the control net from disk.
Definition Control.cpp:334
Control(QString cnetFileName, QObject *parent=0)
Create a Control from control net located on disk.
Definition Control.cpp:35
bool write()
@description Write control net to disk.
Definition Control.cpp:191
void copyToNewProjectRoot(const Project *project, FileName newProjectRoot)
Copies the files of the given Project to the given location.
Definition Control.cpp:294
void setModified(bool modified=true)
@description Sets the modification state of this control.
Definition Control.cpp:241
ControlNet * m_controlNet
A pointer to the ControlNet object associated with this Control object.
Definition Control.h:69
bool isModified()
@description Has this control been modified?
Definition Control.cpp:229
~Control()
Destroys Control object.
Definition Control.cpp:126
void updateFileName(Project *)
Change the on-disk file name for this control to be where the control ought to be in the given projec...
Definition Control.cpp:355
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Method to write this Control object's member data to an XML stream.
Definition Control.cpp:373
void openControlNet()
Sets the ControlNet from the control net file name provided in the constructor.
Definition Control.cpp:165
QString fileName() const
Access the name of the control network file associated with this Control.
Definition Control.cpp:272
ControlDisplayProperties * m_displayProperties
Contains the display properties for this Control object.
Definition Control.h:127
QUuid * m_id
A unique ID for this Control.
Definition Control.h:136
void closeControlNet()
Cleans up the ControlNet pointer.
Definition Control.cpp:214
a control network
Definition ControlNet.h:258
File name manipulation and expansion.
Definition FileName.h:100
The main project for ipce.
Definition Project.h:289
XML Handler that parses XMLs in a stack-oriented way.
Manage a stack of content handlers for reading XML files.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16