Isis 3 Programmer Reference
GuiCameraList.h
1#ifndef GuiCameraList_H
2#define GuiCameraList_H
3
4#include <QDebug>
5#include <QList>
6#include <QMetaType>
7#include <QObject>
8
9#include "GuiCamera.h"
11//#include "GuiCameraListActionWorkOrder.h" TODO - will we need this?
12#include "WorkOrder.h"
13#include "XmlStackedHandler.h"
14
15class QStringList;
16class QXmlStreamWriter;
17
18namespace Isis {
19 class FileName;
20 class XmlStackedHandlerReader;
21
35 class GuiCameraList : public QObject, public QList<GuiCameraQsp> {
36 Q_OBJECT
37
38 public:
39// friend class GuiCameraListActionWorkOrder;
40
41 GuiCameraList(QString name, QString path, QObject *parent = NULL);
42 explicit GuiCameraList(QObject *parent = NULL);
43 explicit GuiCameraList(QList<GuiCameraQsp>, QObject *parent = NULL);
44 explicit GuiCameraList(Project *project,
45 XmlStackedHandlerReader *xmlReader, QObject *parent = NULL);
46// explicit GuiCameraList(QStringList &);
49
50 // These are overridden (-ish) in order to add notifications to the list changing
51 void append(GuiCameraQsp const & value);
52 void append(const QList<GuiCameraQsp> &value);
53
54 void clear();
55
56 iterator erase(iterator pos);
57 iterator erase(iterator begin, iterator end);
58
59 void insert(int i, GuiCameraQsp const & value);
60 iterator insert(iterator before, GuiCameraQsp const & value);
61
62 void prepend(GuiCameraQsp const & value);
63 void push_back(GuiCameraQsp const & value);
64 void push_front(GuiCameraQsp const & value);
65 int removeAll(GuiCameraQsp const & value);
66 void removeAt(int i);
67 void removeFirst();
68 void removeLast();
69 bool removeOne(GuiCameraQsp const & value);
70 void swap(QList<GuiCameraQsp> &other);
71 GuiCameraQsp takeAt(int i);
74
75 GuiCameraList &operator+=(const QList<GuiCameraQsp> &other);
77 GuiCameraList &operator<<(const QList<GuiCameraQsp> &other);
79 GuiCameraList &operator=(const QList<GuiCameraQsp> &rhs);
80
81 // This is our own assignment, but it needs to notify just like the operator=(QList)
83
84 // Done overriding (-ish)
85
86
87 QList<QAction *> supportedActions(Project *project = NULL);
88 bool allSupport(GuiCameraDisplayProperties::Property prop);
89
90 void setName(QString newName);
91 void setPath(QString newPath);
92
93 QString name() const;
94 QString path() const;
95
96// void deleteFromDisk(Project *project);
97 void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
98
99
100 signals:
105 void countChanged(int newCount);
106
107 private:
118 public:
120
121 virtual bool startElement(const QString &namespaceURI, const QString &localName,
122 const QString &qName, const QXmlAttributes &atts);
123 virtual bool endElement(const QString &namespaceURI, const QString &localName,
124 const QString &qName);
125
126 private:
127 Q_DISABLE_COPY(XmlHandler);
128
129 GuiCameraList *m_GuiCameraList;
130 Project *m_project;
131 };
132
133
146// class CopyTargetBodyDataFunctor : public std::unary_function<TargetBodyQsp const &, void *> {
147// public:
148// CopyTargetBodyDataFunctor(const Project *project, FileName newProjectRoot);
149// CopyTargetBodyDataFunctor(const CopyTargetBodyDataFunctor &other);
150// ~CopyTargetBodyDataFunctor();
151
152// void *operator()(TargetBodyQsp const &imageToCopy);
153
154// CopyTargetBodyDataFunctor &operator=(const CopyTargetBodyDataFunctor &rhs);
155
156// private:
157// const Project *m_project;
158// FileName m_newProjectRoot;
159// };
160
161 private:
162// QAction *createWorkOrder(Project *project, GuiCameraListActionWorkOrder::Action action) {
163// QAction *result = NULL;
164
165// if (project) {
166// result = new GuiCameraListActionWorkOrder(action, project);
167// ((GuiCameraListActionWorkOrder *)result)->setData(this);
168// }
169// else {
170// result = new QAction(
171// GuiCameraListActionWorkOrder::qualifyString(GuiCameraListActionWorkOrder::toString(action),
172// this),
173// this);
174// }
175
176// return result;
177// }
178
179// void applyAlphas(QStringList alphaValues);
180// void applyColors(QStringList colorValues, int column = 0);
181// void applyShowLabel(QStringList showLabelValues);
182// void applyShowFill(QStringList showFillValues);
183// void applyShowDNs(QStringList showDNsValues);
184// void applyShowOutline(QStringList showOutlineValues);
185// bool askAlpha(int *alphaResult) const;
186// bool askNewColor(QColor *colorResult) const;
187// QStringList saveAndApplyAlpha(int newAlpha);
188// QStringList saveAndApplyColor(QColor newColor);
189// QStringList saveAndApplyRandomColor();
190
191 private slots:
192// void askAndUpdateAlpha();
193// void askAndUpdateColor();
194// void showRandomColor();
195// QStringList saveAndToggleShowDNs();
196// QStringList saveAndToggleShowFill();
197// QStringList saveAndToggleShowLabel();
198// QStringList saveAndToggleShowOutline();
199
200 private:
201 QString m_name;
202
213 QString m_path;
214 };
215 // TODO: add QDataStream >> and << ???
216}
217
218Q_DECLARE_METATYPE(Isis::GuiCameraList *);
219
220#endif
File name manipulation and expansion.
Definition FileName.h:100
Property
This is a list of properties and actions that are possible.
XmlHandler used to save to xml files.
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Handle an XML start element.
XmlHandler(GuiCameraList *GuiCameraList, Project *project)
Change the visibility of the display name.
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
Handle an XML end element.
List of GuiCameras saved as QSharedPointers.
GuiCameraQsp takeFirst()
Removes and returns the first GuiCamera in the list.
void removeFirst()
Removes the first GuiCamera in the list.
void clear()
Clears the list.
void setName(QString newName)
Gets a list of pre-connected actions that have to do with display, such as color, alpha,...
QString m_name
This functor is used for copying the GuiCamera objects between two projects quickly.
GuiCameraList(QString name, QString path, QObject *parent=NULL)
Create an gui camera list from a gui camera list name and path (does not read GuiCamera objects).
QString name() const
Get the human-readable name of this gui cameray list.
void push_back(GuiCameraQsp const &value)
Inserts a GuiCamera at the end of the list.
void insert(int i, GuiCameraQsp const &value)
Inserts a GuiCamera into the list at a given index.
GuiCameraQsp takeLast()
Removes and returns the last GuiCamera in the list.
int removeAll(GuiCameraQsp const &value)
Removes all occurances of a GuiCamera from the list.
bool removeOne(GuiCameraQsp const &value)
Removes the first occurance of a GuiCamera from the list.
void countChanged(int newCount)
Emitted when the number of GuiCameras in the list changes.
GuiCameraQsp takeAt(int i)
Removes and returns the GuiCamera at a specific index.
void removeAt(int i)
Removes the GuiCamera at a specific index.
void removeLast()
Removes the last GuiCamera in the list.
void prepend(GuiCameraQsp const &value)
Inserts a GuiCamera at the beginning of the list.
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Delete all of the contained GuiCamera objects from disk (see GuiCamera::deleteFromDisk())
void append(GuiCameraQsp const &value)
Appends a single GuiCamera to the list.
QString path() const
Get the path to these gui camera objects in the list (relative to project root).
iterator erase(iterator pos)
Removes the GuiCamera associated with an iterator.
void swap(QList< GuiCameraQsp > &other)
Swaps the list with another GuiCameraList.
~GuiCameraList()
Create a gui camera list from a list of gui camera file names.
void setPath(QString newPath)
Set the relative path (from the project root) to this gui camera list's folder.
GuiCameraList & operator<<(const QList< GuiCameraQsp > &other)
Appends another GuiVameraList to the list and returns a reference to this.
void push_front(GuiCameraQsp const &value)
Inserts a GuiCamera at the front of the list.
GuiCameraList & operator=(const QList< GuiCameraQsp > &rhs)
Assigns a list of GuiCameras to the list.
GuiCameraList & operator+=(const QList< GuiCameraQsp > &other)
Appends another GuiCameraList to the list and returns a reference to this.
QString m_path
This stores the directory name that contains the GuiCamera objects in this list.
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.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16