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
14class QStringList;
15class QXmlStreamWriter;
16
17namespace Isis {
18 class FileName;
19
33 class GuiCameraList : public QObject, public QList<GuiCameraQsp> {
34 Q_OBJECT
35
36 public:
37// friend class GuiCameraListActionWorkOrder;
38
39 GuiCameraList(QString name, QString path, QObject *parent = NULL);
40 explicit GuiCameraList(QObject *parent = NULL);
41 explicit GuiCameraList(QList<GuiCameraQsp>, QObject *parent = NULL);
42// explicit GuiCameraList(QStringList &);
45
46 // These are overridden (-ish) in order to add notifications to the list changing
47 void append(GuiCameraQsp const & value);
48 void append(const QList<GuiCameraQsp> &value);
49
50 void clear();
51
52 iterator erase(iterator pos);
53 iterator erase(iterator begin, iterator end);
54
55 void insert(int i, GuiCameraQsp const & value);
56 iterator insert(iterator before, GuiCameraQsp const & value);
57
58 void prepend(GuiCameraQsp const & value);
59 void push_back(GuiCameraQsp const & value);
60 void push_front(GuiCameraQsp const & value);
61 int removeAll(GuiCameraQsp const & value);
62 void removeAt(int i);
63 void removeFirst();
64 void removeLast();
65 bool removeOne(GuiCameraQsp const & value);
66 void swap(QList<GuiCameraQsp> &other);
67 GuiCameraQsp takeAt(int i);
70
71 GuiCameraList &operator+=(const QList<GuiCameraQsp> &other);
73 GuiCameraList &operator<<(const QList<GuiCameraQsp> &other);
75 GuiCameraList &operator=(const QList<GuiCameraQsp> &rhs);
76
77 // This is our own assignment, but it needs to notify just like the operator=(QList)
79
80 // Done overriding (-ish)
81
82
83 QList<QAction *> supportedActions(Project *project = NULL);
84 bool allSupport(GuiCameraDisplayProperties::Property prop);
85
86 void setName(QString newName);
87 void setPath(QString newPath);
88
89 QString name() const;
90 QString path() const;
91
92// void deleteFromDisk(Project *project);
93 void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
94
95
96 signals:
101 void countChanged(int newCount);
102
115// class CopyTargetBodyDataFunctor : public std::unary_function<TargetBodyQsp const &, void *> {
116// public:
117// CopyTargetBodyDataFunctor(const Project *project, FileName newProjectRoot);
118// CopyTargetBodyDataFunctor(const CopyTargetBodyDataFunctor &other);
119// ~CopyTargetBodyDataFunctor();
120
121// void *operator()(TargetBodyQsp const &imageToCopy);
122
123// CopyTargetBodyDataFunctor &operator=(const CopyTargetBodyDataFunctor &rhs);
124
125// private:
126// const Project *m_project;
127// FileName m_newProjectRoot;
128// };
129
130 private:
131// QAction *createWorkOrder(Project *project, GuiCameraListActionWorkOrder::Action action) {
132// QAction *result = NULL;
133
134// if (project) {
135// result = new GuiCameraListActionWorkOrder(action, project);
136// ((GuiCameraListActionWorkOrder *)result)->setData(this);
137// }
138// else {
139// result = new QAction(
140// GuiCameraListActionWorkOrder::qualifyString(GuiCameraListActionWorkOrder::toString(action),
141// this),
142// this);
143// }
144
145// return result;
146// }
147
148// void applyAlphas(QStringList alphaValues);
149// void applyColors(QStringList colorValues, int column = 0);
150// void applyShowLabel(QStringList showLabelValues);
151// void applyShowFill(QStringList showFillValues);
152// void applyShowDNs(QStringList showDNsValues);
153// void applyShowOutline(QStringList showOutlineValues);
154// bool askAlpha(int *alphaResult) const;
155// bool askNewColor(QColor *colorResult) const;
156// QStringList saveAndApplyAlpha(int newAlpha);
157// QStringList saveAndApplyColor(QColor newColor);
158// QStringList saveAndApplyRandomColor();
159
160 private slots:
161// void askAndUpdateAlpha();
162// void askAndUpdateColor();
163// void showRandomColor();
164// QStringList saveAndToggleShowDNs();
165// QStringList saveAndToggleShowFill();
166// QStringList saveAndToggleShowLabel();
167// QStringList saveAndToggleShowOutline();
168
169 private:
170 QString m_name;
171
182 QString m_path;
183 };
184 // TODO: add QDataStream >> and << ???
185}
186
187Q_DECLARE_METATYPE(Isis::GuiCameraList *);
188
189#endif
File name manipulation and expansion.
Definition FileName.h:100
Property
This is a list of properties and actions that are possible.
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:287
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