Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis Developer Reference
TargetBodyList.h
Go to the documentation of this file.
1#ifndef TargetBodyList_H
2#define TargetBodyList_H
3
4#include <QDebug>
5#include <QObject>
6#include <QList>
7#include <QMetaType>
8
9#include "TargetBody.h"
11//#include "TargetBodyListActionWorkOrder.h" TODO - will we need this?
12#include "WorkOrder.h"
13
14class QXmlStreamWriter;
15
16namespace Isis {
17 class FileName;
18
30 class TargetBodyList : public QObject, public QList<TargetBodyQsp> {
31 Q_OBJECT
32
33 public:
34// friend class TargetBodyListActionWorkOrder;
35
36 TargetBodyList(QString name, QString path, QObject *parent = NULL);
37 explicit TargetBodyList(QObject *parent = NULL);
38 explicit TargetBodyList(QList<TargetBodyQsp>, QObject *parent = NULL);
41
42 // These are overridden (-ish) in order to add notifications to the list changing
43 void append(TargetBodyQsp const &value);
44 void append(const QList<TargetBodyQsp> &value);
45
46 void clear();
47
49 iterator erase(iterator begin, iterator end);
50
51 void insert(int i, TargetBodyQsp const &value);
52 iterator insert(iterator before, TargetBodyQsp const &value);
53
54 void prepend(TargetBodyQsp const &value);
55 void push_back(TargetBodyQsp const &value);
56 void push_front(TargetBodyQsp const &value);
57 int removeAll(TargetBodyQsp const &value);
58 void removeAt(int i);
59 void removeFirst();
60 void removeLast();
61 bool removeOne(TargetBodyQsp const &value);
62 void swap(QList<TargetBodyQsp> &other);
63 TargetBodyQsp takeAt(int i);
66
72
73 // This is our own assignment, but it needs to notify just like the operator=(QList)
75
76 // Done overriding (-ish)
77
78
81
82 void setName(QString newName);
83 void setPath(QString newPath);
84
85 QString name() const;
86 QString path() const;
87
88// void deleteFromDisk(Project *project);
89 void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
90
91
92 signals:
93 void countChanged(int newCount);
94
104// class CopyTargetBodyDataFunctor : public std::unary_function<TargetBodyQsp const &, void *> {
105// public:
106// CopyTargetBodyDataFunctor(const Project *project, FileName newProjectRoot);
107// CopyTargetBodyDataFunctor(const CopyTargetBodyDataFunctor &other);
108// ~CopyTargetBodyDataFunctor();
109
110// void *operator()(TargetBodyQsp const &imageToCopy);
111
112// CopyTargetBodyDataFunctor &operator=(const CopyTargetBodyDataFunctor &rhs);
113
114// private:
115// const Project *m_project;
116// FileName m_newProjectRoot;
117// };
118
119 private:
120// QAction *createWorkOrder(Project *project, TargetBodyListActionWorkOrder::Action action) {
121// QAction *result = NULL;
122
123// if (project) {
124// result = new TargetBodyListActionWorkOrder(action, project);
125// ((TargetBodyListActionWorkOrder *)result)->setData(this);
126// }
127// else {
128// result = new QAction(
129// TargetBodyListActionWorkOrder::qualifyString(TargetBodyListActionWorkOrder::toString(action),
130// this),
131// this);
132// }
133
134// return result;
135// }
136
137// void applyAlphas(QStringList alphaValues);
138// void applyColors(QStringList colorValues, int column = 0);
139// void applyShowLabel(QStringList showLabelValues);
140// void applyShowFill(QStringList showFillValues);
141// void applyShowDNs(QStringList showDNsValues);
142// void applyShowOutline(QStringList showOutlineValues);
143// bool askAlpha(int *alphaResult) const;
144// bool askNewColor(QColor *colorResult) const;
145// QStringList saveAndApplyAlpha(int newAlpha);
146// QStringList saveAndApplyColor(QColor newColor);
147// QStringList saveAndApplyRandomColor();
148
149 private slots:
150// void askAndUpdateAlpha();
151// void askAndUpdateColor();
152// void showRandomColor();
153// QStringList saveAndToggleShowDNs();
154// QStringList saveAndToggleShowFill();
155// QStringList saveAndToggleShowLabel();
156// QStringList saveAndToggleShowOutline();
157
158 private:
159 QString m_name;
160
171 QString m_path;
172 };
173
174}
175
177
178#endif
Q_DECLARE_METATYPE(Isis::TargetBodyList *)
The main project for ipce.
Definition Project.h:287
Property
This is a list of properties and actions that are possible.
Definition TargetBodyDisplayProperties.h:67
List for holding TargetBodies.
Definition TargetBodyList.h:30
TargetBodyList & operator<<(const QList< TargetBodyQsp > &other)
Appends another TargetBodyList to the list.
Definition TargetBodyList.cpp:423
void countChanged(int newCount)
TargetBodyList & operator=(const QList< TargetBodyQsp > &rhs)
Assignment operator for a QList of TargetBodyQsp.
Definition TargetBodyList.cpp:459
void setPath(QString newPath)
Set the relative path (from the project root) to this target body list's folder.
Definition TargetBodyList.cpp:647
void removeLast()
Removes the last TargetBody from the list.
Definition TargetBodyList.cpp:292
QList< QAction * > supportedActions(Project *project=NULL)
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Delete all of the contained TargetBody objects from disk (see TargetBody::deleteFromDisk())
Definition TargetBodyList.cpp:712
iterator erase(iterator pos)
Erases the TargetBody associated with an iterator.
Definition TargetBodyList.cpp:145
QString path() const
Get the path to these target body objects in the list (relative to project root).
Definition TargetBodyList.cpp:669
void swap(QList< TargetBodyQsp > &other)
Swaps the list with another TargetBodyList.
Definition TargetBodyList.cpp:325
TargetBodyQsp takeLast()
Removes and returns the last TargetBody in the list.
Definition TargetBodyList.cpp:371
void insert(int i, TargetBodyQsp const &value)
Inserts a TargetBody at a specific index.
Definition TargetBodyList.cpp:179
void append(TargetBodyQsp const &value)
Appends a TargetBody to the list.
Definition TargetBodyList.cpp:105
bool removeOne(TargetBodyQsp const &value)
Removes the first occurrence of a TargetBody from the list.
Definition TargetBodyList.cpp:307
void push_front(TargetBodyQsp const &value)
Insertes a TargetBody at the front of the list.
Definition TargetBodyList.cpp:237
TargetBodyList & operator+=(const QList< TargetBodyQsp > &other)
Appends another TargetBodyList to the list.
Definition TargetBodyList.cpp:387
TargetBodyList(QString name, QString path, QObject *parent=NULL)
Create an target body list from an target body list name and path (does not read TargetBody objects).
Definition TargetBodyList.cpp:37
QString name() const
Get the human-readable name of this target body list.
Definition TargetBodyList.cpp:657
void removeFirst()
Removes the first TargetBody from the list.
Definition TargetBodyList.cpp:281
int removeAll(TargetBodyQsp const &value)
Removes all occurrences of a TargetBody and returns the number removed.
Definition TargetBodyList.cpp:252
void prepend(TargetBodyQsp const &value)
Inserts a TargetBody at the front of the list.
Definition TargetBodyList.cpp:211
void push_back(TargetBodyQsp const &value)
Appends a TargetBody to the end of the list.
Definition TargetBodyList.cpp:224
TargetBodyQsp takeFirst()
Removes and returns the first TargetBody in the list.
Definition TargetBodyList.cpp:357
~TargetBodyList()
Create an target body list from a list of target body file names.
Definition TargetBodyList.cpp:94
void setName(QString newName)
Gets a list of pre-connected actions that have to do with display, such as color, alpha,...
Definition TargetBodyList.cpp:636
void removeAt(int i)
Removes the TargetBody at a specific index.
Definition TargetBodyList.cpp:270
void clear()
clears the list.
Definition TargetBodyList.cpp:129
TargetBodyQsp takeAt(int i)
Removes and returns the TargetBody at a specific index.
Definition TargetBodyList.cpp:343
bool allSupport(TargetBodyDisplayProperties::Property prop)
This is free and unencumbered software released into the public domain.
Definition BoxcarCachingAlgorithm.h:13
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
QSharedPointer< TargetBody > TargetBodyQsp
Defines A smart pointer to a TargetBody obj.
Definition TargetBody.h:182