Isis 3.0 Programmer Reference
Back | Home
Control.h
Go to the documentation of this file.
1 #ifndef Control_H
2 #define Control_H
3 
25 #include <QObject> // parent
26 
27 #include <QString>
28 
29 #include "FileName.h"
30 #include "XmlStackedHandler.h"
31 
32 class QMutex;
33 class QUuid;
34 class QXmlStreamWriter;
35 
36 namespace Isis {
37  class ControlDisplayProperties;
38  class ControlNet;
39  class FileName;
40  class Project;
41  class PvlObject;
42 
57  class Control : public QObject {
58  Q_OBJECT
59  public:
60  explicit Control(QString cnetFileName, QObject *parent = 0);
61  explicit Control(ControlNet *controlNet, QString cnetFileName, QObject *parent = 0);
62  Control(FileName cnetFolder, XmlStackedHandlerReader *xmlReader, QObject *parent = 0);
63  ~Control();
64 
66  void openControlNet();
67  void closeControlNet();
70  QString fileName() const;
71 
72  QString id() const;
73 
74  void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
75  void copyToNewProjectRoot(const Project *project, FileName newProjectRoot);
76  void deleteFromDisk();
77 
78  public slots:
79  void updateFileName(Project *);
80 
81  private:
90  class XmlHandler : public XmlStackedHandler {
91  public:
92  XmlHandler(Control *control, FileName cnetFolder);
93 
94  virtual bool startElement(const QString &namespaceURI, const QString &localName,
95  const QString &qName, const QXmlAttributes &atts);
96 
97  private:
98  Q_DISABLE_COPY(XmlHandler);
99 
103  };
104 
105  private:
106  Control(const Control &other);
107  Control &operator=(const Control &rhs);
108 
113  QString m_fileName;
119  QUuid *m_id;
120  };
121 }
122 
124 
125 #endif // Control_H
This represents an ISIS control net in a project-based GUI interface.
Definition: Control.h:57
The main project for cnetsuite.
Definition: Project.h:105
void deleteFromDisk()
Delete the control net from disk.
Definition: Control.cpp:210
File name manipulation and expansion.
Definition: FileName.h:111
Control(QString cnetFileName, QObject *parent=0)
Create a Control from control net located on disk.
Definition: Control.cpp:27
ControlDisplayProperties * m_displayProperties
Contains the display properties for this Control object.
Definition: Control.h:111
QUuid * m_id
A unique ID for this Control.
Definition: Control.h:119
void copyToNewProjectRoot(const Project *project, FileName newProjectRoot)
Copies the files of the given Project to the given location.
Definition: Control.cpp:193
FileName m_xmlHandlerCnetFolderName
The name of the folder for the control xml.
Definition: Control.h:102
Nested class used to write the Control object information to an XML file for the purpose of saving an...
Definition: Control.h:90
Q_DECLARE_METATYPE(Isis::Cube *)
This allows Cube *&#39;s to be stored in a QVariant.
QString id() const
Access the unique ID associated with this Control.
Definition: Control.cpp:181
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:286
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Method to write this Control object&#39;s member data to an XML stream.
Definition: Control.cpp:248
void closeControlNet()
Cleans up the ControlNet pointer.
Definition: Control.cpp:138
This is the GUI communication mechanism for cubes.
void openControlNet()
Sets the ControlNet from the control net file name provided in the constructor.
Definition: Control.cpp:121
a control network
Definition: ControlNet.h:207
~Control()
Destroys Control object.
Definition: Control.cpp:85
XML Handler that parses XMLs in a stack-oriented way.
QString fileName() const
Access the name of the control network file associated with this Control.
Definition: Control.cpp:171
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:230
ControlNet * controlNet()
Open and return a pointer to the ControlNet for this Control.
Definition: Control.cpp:106
XmlHandler(Control *control, FileName cnetFolder)
Constructor for the Control object&#39;s XmlHandler.
Definition: Control.cpp:268
ControlNet * m_controlNet
A pointer to the ControlNet object associated with this Control object.
Definition: Control.h:109
QString m_fileName
File name of the control net associated with this control.
Definition: Control.h:113
ControlDisplayProperties * displayProperties()
Access a pointer to the display properties for the control network.
Definition: Control.cpp:151
Control * m_xmlHandlerControl
A pointer to the Control object to be read or written.
Definition: Control.h:100
his enables stack-based XML parsing of XML 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:16:14