Isis 3 Programmer Reference
Control.h
Go to the documentation of this file.
1 #ifndef Control_H
2 #define Control_H
3 
25 #include <QObject> // parent
26 #include <QString>
27 
28 #include "FileName.h"
29 #include "XmlStackedHandler.h"
30 
31 class QMutex;
32 class QUuid;
33 class QXmlStreamWriter;
34 
35 namespace Isis {
36  class ControlDisplayProperties;
37  class ControlNet;
38  class FileName;
39  class Project;
40  class PvlObject;
41 
79  class Control : public QObject {
80  Q_OBJECT
81  public:
84  explicit Control(QString cnetFileName, QObject *parent = 0);
85  explicit Control(Project *project, QString cnetFileName, QObject *parent = 0);
86  explicit Control(ControlNet *controlNet, QString cnetFileName, QObject *parent = 0);
87  Control(FileName cnetFolder, XmlStackedHandlerReader *xmlReader, QObject *parent = 0);
88  ~Control();
89 
91  void openControlNet();
94  QString fileName() const;
95 
96  QString id() const;
97 
98  bool isModified();
99  void setModified(bool modified = true);
100  bool write();
101 
102  void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
103  void copyToNewProjectRoot(const Project *project, FileName newProjectRoot);
104  void deleteFromDisk();
105 
106  public slots:
107  void updateFileName(Project *);
108  void closeControlNet();
109 
110  private:
119  class XmlHandler : public XmlStackedHandler {
120  public:
121  XmlHandler(Control *control, FileName cnetFolder);
122 
123  virtual bool startElement(const QString &namespaceURI, const QString &localName,
124  const QString &qName, const QXmlAttributes &atts);
125 
126  private:
127  Q_DISABLE_COPY(XmlHandler);
128 
132  };
133 
134  private:
135  Control(const Control &other);
136  Control &operator=(const Control &rhs);
137 
138  bool m_modified;
139 
142  Project *m_project;
143  QString m_fileName;
149  QUuid *m_id;
150  };
151 }
152 
154 
155 #endif // Control_H
This represents an ISIS control net in a project-based GUI interface.
Definition: Control.h:79
The main project for ipce.
Definition: Project.h:289
void deleteFromDisk()
Delete the control net from disk.
Definition: Control.cpp:326
File name manipulation and expansion.
Definition: FileName.h:116
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:140
QUuid * m_id
A unique ID for this Control.
Definition: Control.h:149
void copyToNewProjectRoot(const Project *project, FileName newProjectRoot)
Copies the files of the given Project to the given location.
Definition: Control.cpp:286
FileName m_xmlHandlerCnetFolderName
The name of the folder for the control xml.
Definition: Control.h:131
Nested class used to write the Control object information to an XML file for the purpose of saving an...
Definition: Control.h:119
Q_DECLARE_METATYPE(Isis::Cube *)
This allows Cube *&#39;s to be stored in a QVariant.
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:365
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:403
void closeControlNet()
Cleans up the ControlNet pointer.
Definition: Control.cpp:206
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:157
bool isModified()
Has this control been modified?
Definition: Control.cpp:221
a control network
Definition: ControlNet.h:271
bool write()
Write control net to disk.
Definition: Control.cpp:183
~Control()
Destroys Control object.
Definition: Control.cpp:118
XML Handler that parses XMLs in a stack-oriented way.
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:347
ControlNet * controlNet()
Open and return a pointer to the ControlNet for this Control.
Definition: Control.cpp:142
XmlHandler(Control *control, FileName cnetFolder)
Constructor for the Control object&#39;s XmlHandler.
Definition: Control.cpp:385
ControlNet * m_controlNet
A pointer to the ControlNet object associated with this Control object.
Definition: Control.h:82
QString m_fileName
Project associated with this control.
Definition: Control.h:143
ControlDisplayProperties * displayProperties()
Access a pointer to the display properties for the control network.
Definition: Control.cpp:244
void setModified(bool modified=true)
Sets the modification state of this control.
Definition: Control.cpp:233
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Control * m_xmlHandlerControl
A pointer to the Control object to be read or written.
Definition: Control.h:129
QString id() const
Access the unique ID associated with this Control.
Definition: Control.cpp:274
Manage a stack of content handlers for reading XML files.
QString fileName() const
Access the name of the control network file associated with this Control.
Definition: Control.cpp:264