Isis 3.0
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 
100  Control *m_xmlHandlerControl;
102  FileName m_xmlHandlerCnetFolderName;
103  };
104 
105  private:
106  Control(const Control &other);
107  Control &operator=(const Control &rhs);
108 
109  ControlNet *m_controlNet;
111  ControlDisplayProperties *m_displayProperties;
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
void copyToNewProjectRoot(const Project *project, FileName newProjectRoot)
Copies the files of the given Project to the given location.
Definition: Control.cpp:193
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
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.
Definition: ControlDisplayProperties.h:73
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.
Definition: XmlStackedHandler.h:47
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
ControlDisplayProperties * displayProperties()
Access a pointer to the display properties for the control network.
Definition: Control.cpp:151
his enables stack-based XML parsing of XML files.
Definition: XmlStackedHandlerReader.h:26

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