Isis 3.0 Programmer Reference
Back | Home
ImageList.cpp
Go to the documentation of this file.
1 
23 #include "ImageList.h"
24 
25 #include <QAction>
26 #include <QColorDialog>
27 #include <QDebug>
28 #include <QDir>
29 #include <QFile>
30 #include <QFuture>
31 #include <QInputDialog>
32 #include <QLabel>
33 #include <QProgressDialog>
34 #include <QtConcurrentMap>
35 #include <QXmlStreamWriter>
36 
37 #include "Color.h"
38 #include "FileName.h"
39 #include "IException.h"
40 #include "IString.h"
41 #include "Project.h"
42 #include "XmlStackedHandlerReader.h"
43 
44 namespace Isis {
52  ImageList::ImageList(QString name, QString path, QObject *parent) : QObject(parent) {
53  m_name = name;
54  m_path = path;
55  }
56 
57 
63  ImageList::ImageList(QObject *parent) : QObject(parent) {
64  }
65 
66 
73  ImageList::ImageList(QList<Image *> images, QObject *parent) : QObject(parent) {
74  append(images);
75  }
76 
77 
86  QObject(parent) {
87  xmlReader->pushContentHandler(new XmlHandler(this, project));
88  }
89 
90 
97  QList<Image *>(other) {
98  m_name = other.m_name;
99  m_path = other.m_path;
100  }
101 
102 
109  foreach (QString fileName, fileNames) {
110  try {
111  Image *image = new Image(fileName);
112  append(image);
113  }
114  catch (IException &) {
115  }
116  }
117  }
118 
119 
124  }
125 
126 
133 
134  SerialNumberList *result = new SerialNumberList();
135 
136  for (int i = 0; i < count(); i++) {
137  result->add((*this)[i]->fileName());
138  }
139  return result;
140  }
141 
142 
150  void ImageList::append(Image * const &value) {
151  QList<Image *>::append(value);
152  emit countChanged(count());
153  }
154 
155 
163  void ImageList::append(const QList<Image *> &value) {
164  QList<Image *>::append(value);
165  emit countChanged(count());
166  }
167 
168 
175  bool countChanging = count();
177  if (countChanging) {
178  emit countChanged(count());
179  }
180  }
181 
182 
193  iterator result = QList<Image *>::erase(pos);
194  emit countChanged(count());
195  return result;
196  }
197 
198 
211  QList<Image *>::iterator ImageList::erase(iterator begin, iterator end) {
212  iterator result = QList<Image *>::erase(begin, end);
213  emit countChanged(count());
214  return result;
215  }
216 
217 
226  void ImageList::insert(int i, Image * const &value) {
227  QList<Image *>::insert(i, value);
228 
229  emit countChanged(count());
230  }
231 
232 
243  QList<Image *>::iterator ImageList::insert(iterator before, Image * const &value) {
244  iterator result = QList<Image *>::insert(before, value);
245  emit countChanged(count());
246  return result;
247  }
248 
249 
257  void ImageList::prepend(Image * const &value) {
259  emit countChanged(count());
260  }
261 
262 
271  void ImageList::push_back(Image * const &value) {
273  emit countChanged(count());
274  }
275 
276 
285  void ImageList::push_front(Image * const &value) {
287  emit countChanged(count());
288  }
289 
290 
300  int ImageList::removeAll(Image * const &value) {
301  int result = QList<Image *>::removeAll(value);
302 
303  if (result != 0) {
304  emit countChanged(count());
305  }
306 
307  return result;
308  }
309 
310 
318  void ImageList::removeAt(int i) {
320  emit countChanged(count());
321  }
322 
323 
331  emit countChanged(count());
332  }
333 
334 
342  emit countChanged(count());
343  }
344 
345 
355  bool ImageList::removeOne(Image * const &value) {
356  bool result = QList<Image *>::removeOne(value);
357 
358  if (result) {
359  emit countChanged(count());
360  }
361 
362  return result;
363  }
364 
365 
374  QList<Image *>::swap(other);
375 
376  if (count() != other.count()) {
377  emit countChanged(count());
378  }
379  }
380 
381 
392  Image * result = QList<Image *>::takeAt(i);
393  emit countChanged(count());
394  return result;
395  }
396 
397 
406  Image *result = QList<Image *>::takeFirst();
407  emit countChanged(count());
408  return result;
409  }
410 
411 
420  Image *result = QList<Image *>::takeLast();
421  emit countChanged(count());
422  return result;
423  }
424 
425 
438 
439  if (other.count()) {
440  emit countChanged(count());
441  }
442 
443  return *this;
444  }
445 
446 
459  emit countChanged(count());
460  return *this;
461  }
462 
463 
474  ImageList &ImageList::operator<<(const QList<Image *> &other) {
476 
477  if (other.count()) {
478  emit countChanged(count());
479  }
480 
481  return *this;
482  }
483 
484 
497  emit countChanged(count());
498  return *this;
499  }
500 
501 
512  bool countChanging = (rhs.count() != count());
514 
515  if (countChanging) {
516  emit countChanged(count());
517  }
518 
519  return *this;
520  }
521 
522 
531  bool countChanging = (rhs.count() != count());
533 
534  m_name = rhs.m_name;
535  m_path = rhs.m_path;
536 
537  if (countChanging) {
538  emit countChanged(count());
539  }
540 
541  return *this;
542  }
543 
544 
558  QList<QAction *> actions;
559 
560  // It turns out connect() statements cannot be templated, hence they aren't inside of
561  // createWorkOrder().
564  if (!project) {
565  connect(alphaAction, SIGNAL(triggered()),
566  this, SLOT(askAndUpdateAlpha()));
567  }
568  actions.append(alphaAction);
569 
571  if (!project) {
572  connect(colorAction, SIGNAL(triggered()),
573  this, SLOT(askAndUpdateColor()));
574  }
575  actions.append(colorAction);
576 
577 
579  if (!project) {
580  connect(ranColorAction, SIGNAL(triggered()),
581  this, SLOT(showRandomColor()));
582  }
583  actions.append(ranColorAction);
584  }
585 
586 
588  QAction *labelVisibleAction = createWorkOrder(project,
590  if (!project) {
591  connect(labelVisibleAction, SIGNAL(triggered()),
592  this, SLOT(saveAndToggleShowLabel()));
593  }
594  actions.append(labelVisibleAction);
595  }
596 
597 
600  if (!project) {
601  connect(fillAction, SIGNAL(triggered()),
602  this, SLOT(saveAndToggleShowFill()));
603  }
604  actions.append(fillAction);
605  }
606 
607 
609  QAction *cubeDataAction = createWorkOrder(project,
611  if (!project) {
612  connect(cubeDataAction, SIGNAL(triggered()),
613  this, SLOT(saveAndToggleShowDNs()));
614  }
615  actions.append(cubeDataAction);
616  }
617 
618 
620  QAction *outlineAction = createWorkOrder(project,
622  if (!project) {
623  connect(outlineAction, SIGNAL(triggered()),
624  this, SLOT(saveAndToggleShowOutline()));
625  }
626  actions.append(outlineAction);
627  }
628 
629  actions.append(NULL);
630 
631  if (!project) {
633  QAction *moveToTopAct = new QAction(tr("Bring to Front"), this);
634  QAction *moveUpAct = new QAction(tr("Bring Forward"), this);
635  QAction *moveToBottomAct = new QAction(tr("Send to Back"), this);
636  QAction *moveDownAct = new QAction(tr("Send Backward"), this);
637 
638  foreach (Image *image, *this) {
639  connect(moveToTopAct, SIGNAL(triggered()),
640  image->displayProperties(), SIGNAL(moveToTop()));
641 
642  connect(moveUpAct, SIGNAL(triggered()),
643  image->displayProperties(), SIGNAL(moveUpOne()));
644 
645  connect(moveToBottomAct, SIGNAL(triggered()),
646  image->displayProperties(), SIGNAL(moveToBottom()));
647 
648  connect(moveDownAct, SIGNAL(triggered()),
649  image->displayProperties(), SIGNAL(moveDownOne()));
650  }
651  actions.append(moveToTopAct);
652  actions.append(moveUpAct);
653  actions.append(moveToBottomAct);
654  actions.append(moveDownAct);
655  }
656 
657  actions.append(NULL);
658 
659  if (size() == 1 && allSupport(ImageDisplayProperties::Zooming)) {
660  QAction *zoomFit = new QAction(tr("Zoom Fit"), this);
661  connect(zoomFit, SIGNAL(triggered()),
662  first()->displayProperties(), SIGNAL(zoomFit()));
663  actions.append(zoomFit);
664  }
665  }
666 
667  return actions;
668  }
669 
670 
680  if (isEmpty())
681  return false;
682 
683  foreach (Image *image, *this) {
684  if (!image->displayProperties()->supports(prop))
685  return false;
686  }
687 
688  return true;
689  }
690 
691 
698  void ImageList::setName(QString newName) {
699  m_name = newName;
700  }
701 
702 
709  void ImageList::setPath(QString newPath) {
710  m_path = newPath;
711  }
712 
713 
719  QString ImageList::name() const {
720  return m_name;
721  }
722 
723 
730  QString ImageList::path() const {
731  return m_path;
732  }
733 
734 
743  foreach (Image *image, *this) {
744  image->deleteFromDisk();
745  }
746 
747  if (!m_path.isEmpty()) {
748  QFile::remove(project->imageDataRoot() + "/" + m_path + "/images.xml");
749 
750  QDir dir;
751  dir.rmdir(project->imageDataRoot() + "/" + m_path);
752  }
753  }
754 
755 
779  void ImageList::save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot)
780  const {
781  stream.writeStartElement("imageList");
782  stream.writeAttribute("name", m_name);
783  stream.writeAttribute("path", m_path);
784 
785  FileName settingsFileName(
786  Project::imageDataRoot(newProjectRoot.toString()) + "/" + m_path + "/images.xml");
787 
788  if (!settingsFileName.dir().mkpath(settingsFileName.path())) {
790  QString("Failed to create directory [%1]")
791  .arg(settingsFileName.path()),
792  _FILEINFO_);
793  }
794 
795  QFile imageListContentsFile(settingsFileName.toString());
796 
797  if (!imageListContentsFile.open(QIODevice::ReadWrite | QIODevice::Truncate)) {
799  QString("Unable to save image information for [%1] because [%2] could not be opened for "
800  "writing")
801  .arg(m_name).arg(settingsFileName.original()),
802  _FILEINFO_);
803  }
804 
805  QXmlStreamWriter imageDetailsWriter(&imageListContentsFile);
806  imageDetailsWriter.setAutoFormatting(true);
807  imageDetailsWriter.writeStartDocument();
808 
809  int countWidth = QString("%1L").arg(count()).size() - 1;
810  QChar paddingChar('0');
811 
812  QLabel *progressLabel = new QLabel;
813 
814  QProgressDialog progressDialog;
815  progressDialog.setLabel(progressLabel);
816  progressDialog.setRange(-1, count());
817  progressDialog.setValue(-1);
818 
819  imageDetailsWriter.writeStartElement("images");
820  // Mapped is way faster than hundreds/thousands of run() calls... so use mapped for performance
821  QFuture<void *> future = QtConcurrent::mapped(*this,
822  CopyImageDataFunctor(project, newProjectRoot));
823 
824  for (int i = 0; i < count(); i++) {
825  int newProgressValue = progressDialog.value() + 1;
826  progressLabel->setText(
827  tr("Saving Image Information for [%1] - %L2/%L3 done")
828  .arg(m_name)
829  .arg(newProgressValue, countWidth, 10, paddingChar)
830  .arg(count()));
831  progressDialog.setValue(newProgressValue);
832  future.resultAt(i);
833  }
834 
835  progressLabel->setText(tr("Finalizing..."));
836  progressDialog.setRange(0, 0);
837  progressDialog.setValue(0);
838 
839  foreach (Image *image, *this) {
840  image->save(imageDetailsWriter, project, newProjectRoot);
841  }
842 
843  imageDetailsWriter.writeEndElement();
844 
845  imageDetailsWriter.writeEndDocument();
846 
847  stream.writeEndElement();
848  }
849 
850 
858  FileName newProjectRoot) {
859  m_project = project;
860  m_newProjectRoot = newProjectRoot;
861  }
862 
863 
870  m_project = other.m_project;
871  m_newProjectRoot = other.m_newProjectRoot;
872  }
873 
874 
879  }
880 
881 
891  imageToCopy->copyToNewProjectRoot(m_project, m_newProjectRoot);
892  return NULL;
893  }
894 
895 
904  const CopyImageDataFunctor &rhs) {
905  m_project = rhs.m_project;
906  m_newProjectRoot = rhs.m_newProjectRoot;
907  return *this;
908  }
909 
910 
920  if (count() == alphaValues.count()) {
921  for (int i = 0; i < count(); i++) {
922  ImageDisplayProperties *dispProps = (*this)[i]->displayProperties();
923  QColor color = dispProps->getValue(ImageDisplayProperties::Color).value<QColor>();
924  color.setAlpha(alphaValues[i].toInt());
925  dispProps->setColor(color);
926  }
927  }
928  }
929 
930 
940  void ImageList::applyColors(QStringList colorValues, int column) {
941  if (count() == colorValues.count()) {
942  for (int i = 0; i < count(); i++) {
943  QString colorData = colorValues[i].split(" ")[column];
944  (*this)[i]->displayProperties()->setColor(Color::fromRGBAString(colorData));
945  }
946  }
947  }
948 
949 
960  void ImageList::applyShowLabel(QStringList showLabelValues) {
961  if (count() == showLabelValues.count()) {
962  for (int i = 0; i < count(); i++) {
963  ImageDisplayProperties *dispProps = (*this)[i]->displayProperties();
964  dispProps->setShowLabel(showLabelValues[i] == "shown");
965  }
966  }
967  }
968 
969 
980  void ImageList::applyShowFill(QStringList showFillValues) {
981  if (count() == showFillValues.count()) {
982  for (int i = 0; i < count(); i++) {
983  ImageDisplayProperties *dispProps = (*this)[i]->displayProperties();
984  dispProps->setShowFill(showFillValues[i] == "shown");
985  }
986  }
987  }
988 
989 
999  void ImageList::applyShowDNs(QStringList showDNsValues) {
1000  if (count() == showDNsValues.count()) {
1001  for (int i = 0; i < count(); i++) {
1002  ImageDisplayProperties *dispProps = (*this)[i]->displayProperties();
1003  dispProps->setShowDNs(showDNsValues[i] == "shown");
1004  }
1005  }
1006  }
1007 
1008 
1018  void ImageList::applyShowOutline(QStringList showOutlineValues) {
1019  if (count() == showOutlineValues.count()) {
1020  for (int i = 0; i < count(); i++) {
1021  ImageDisplayProperties *dispProps = (*this)[i]->displayProperties();
1022  dispProps->setShowOutline(showOutlineValues[i] == "shown");
1023  }
1024  }
1025  }
1026 
1027 
1041  bool ImageList::askAlpha(int *alphaResult) const {
1042  bool result = false;
1043 
1044  if (!isEmpty()) {
1045  ImageDisplayProperties *dispProps = first()->displayProperties();
1046  *alphaResult = QInputDialog::getInt(NULL, "Transparency Value",
1047  "Set the cube's transparency\nValues are 0 (invisible) to 255 (solid)",
1048  dispProps->getValue(ImageDisplayProperties::Color).value<QColor>().alpha(),
1049  0, 255, 1, &result);
1050  }
1051 
1052  return result;
1053  }
1054 
1055 
1069  bool ImageList::askNewColor(QColor *colorResult) const {
1070  *colorResult = QColor();
1071 
1072  if (!isEmpty()) {
1073  ImageDisplayProperties *dispProps = first()->displayProperties();
1074  *colorResult = QColorDialog::getColor(
1075  dispProps->getValue(ImageDisplayProperties::Color).value<QColor>(), NULL,
1076  "Cube Display Color",
1077  QColorDialog::ShowAlphaChannel);
1078  }
1079 
1080  return colorResult->isValid();
1081  }
1082 
1083 
1093  QStringList results;
1094  foreach (Image *image, *this) {
1095  ImageDisplayProperties *displayProperties = image->displayProperties();
1096 
1097  QColor displayColor = displayProperties->getValue(
1098  ImageDisplayProperties::Color).value<QColor>();
1099 
1100  results.append(QString::number(displayColor.alpha()));
1101 
1102  displayColor.setAlpha(newAlpha);
1103  displayProperties->setColor(displayColor);
1104  }
1105 
1106  return results;
1107  }
1108 
1109 
1120  QStringList results;
1121 
1122  if (newColor.isValid()) {
1123  foreach (Image *image, *this) {
1124  ImageDisplayProperties *displayProperties = image->displayProperties();
1125 
1126  QColor displayColor = displayProperties->getValue(
1127  ImageDisplayProperties::Color).value<QColor>();
1128 
1129  results.append(Color::toRGBAString(displayColor));
1130 
1131  displayProperties->setColor(newColor);
1132  }
1133  }
1134 
1135  return results;
1136  }
1137 
1138 
1147  QStringList results;
1148 
1149  foreach (Image *image, *this) {
1150  QColor ranColor = ImageDisplayProperties::randomColor();
1151 
1152  ImageDisplayProperties *displayProperties = image->displayProperties();
1153 
1154  QColor displayColor = displayProperties->getValue(
1155  ImageDisplayProperties::Color).value<QColor>();
1156 
1157  // Preserve alpha
1158  ranColor.setAlpha(displayColor.alpha());
1159 
1160  // QColor::name() doesn't preserve alpha.
1161  results.append(
1162  QString("%1 %2").arg(Color::toRGBAString(displayColor))
1163  .arg(Color::toRGBAString(ranColor)));
1164 
1165  displayProperties->setColor(ranColor);
1166  }
1167 
1168  return results;
1169  }
1170 
1171 
1177  int newAlpha = 255;
1178 
1179  if (askAlpha(&newAlpha)) {
1180  saveAndApplyAlpha(newAlpha);
1181  }
1182  }
1183 
1184 
1190  QColor newColor;
1191  askNewColor(&newColor);
1192  saveAndApplyColor(newColor);
1193  }
1194 
1195 
1201  foreach (Image *image, *this) {
1202  QColor ranColor = ImageDisplayProperties::randomColor();
1203  image->displayProperties()->setColor(ranColor);
1204  }
1205  }
1206 
1207 
1215  QStringList results;
1216 
1217  if (!isEmpty()) {
1218  ImageDisplayProperties *firstDisplayProperties = first()->displayProperties();
1219  bool newValue = !firstDisplayProperties->getValue(ImageDisplayProperties::ShowDNs).toBool();
1220 
1221  foreach (Image *image, *this) {
1222  ImageDisplayProperties *displayProps = image->displayProperties();
1223 
1224  bool value = displayProps->getValue(ImageDisplayProperties::ShowDNs).toBool();
1225  results.append(value? "shown" : "hidden");
1226 
1227  image->displayProperties()->setShowDNs(newValue);
1228  }
1229  }
1230 
1231  return results;
1232  }
1233 
1234 
1243  QStringList results;
1244 
1245  if (!isEmpty()) {
1246  ImageDisplayProperties *firstDisplayProps = first()->displayProperties();
1247  bool newValue = !firstDisplayProps->getValue(ImageDisplayProperties::ShowFill).toBool();
1248 
1249  foreach (Image *image, *this) {
1250  ImageDisplayProperties *displayProps = image->displayProperties();
1251 
1252  bool value = displayProps->getValue(ImageDisplayProperties::ShowFill).toBool();
1253  results.append(value? "shown" : "hidden");
1254 
1255  image->displayProperties()->setShowFill(newValue);
1256  }
1257  }
1258 
1259  return results;
1260  }
1261 
1262 
1271  QStringList results;
1272 
1273  if (!isEmpty()) {
1274  ImageDisplayProperties *firstDisplayProps = first()->displayProperties();
1275  bool newValue = !firstDisplayProps->getValue(ImageDisplayProperties::ShowLabel).toBool();
1276 
1277  foreach (Image *image, *this) {
1278  ImageDisplayProperties *displayProps = image->displayProperties();
1279 
1280  bool value = displayProps->getValue(ImageDisplayProperties::ShowLabel).toBool();
1281  results.append(value? "shown" : "hidden");
1282 
1283  image->displayProperties()->setShowLabel(newValue);
1284  }
1285  }
1286 
1287  return results;
1288  }
1289 
1290 
1299  QStringList results;
1300 
1301  if (!isEmpty()) {
1302  ImageDisplayProperties *firstDisplayProps = first()->displayProperties();
1303  bool newValue = !firstDisplayProps->getValue(ImageDisplayProperties::ShowOutline).toBool();
1304 
1305  foreach (Image *image, *this) {
1306  ImageDisplayProperties *displayProps = image->displayProperties();
1307 
1308  bool value = displayProps->getValue(ImageDisplayProperties::ShowOutline).toBool();
1309  results.append(value? "shown" : "hidden");
1310 
1311  image->displayProperties()->setShowOutline(newValue);
1312  }
1313  }
1314 
1315  return results;
1316  }
1317 
1318 
1328  m_imageList = imageList;
1329  m_project = project;
1330  }
1331 
1332 
1339  bool ImageList::XmlHandler::startElement(const QString &namespaceURI, const QString &localName,
1340  const QString &qName, const QXmlAttributes &atts) {
1341  if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) {
1342  if (localName == "imageList") {
1343  QString name = atts.value("name");
1344  QString path = atts.value("path");
1345 
1346  if (!name.isEmpty()) {
1347  m_imageList->setName(name);
1348  }
1349 
1350  if (!path.isEmpty()) {
1351  m_imageList->setPath(path);
1352  }
1353  }
1354  else if (localName == "image") {
1355  m_imageList->append(new Image(m_project->imageDataRoot() + "/" + m_imageList->path(),
1356  reader()));
1357  }
1358  }
1359 
1360  return true;
1361  }
1362 
1363 
1373  bool ImageList::XmlHandler::endElement(const QString &namespaceURI, const QString &localName,
1374  const QString &qName) {
1375  if (localName == "imageList") {
1376  XmlHandler handler(m_imageList, m_project);
1377 
1378  XmlStackedHandlerReader reader;
1379  reader.pushContentHandler(&handler);
1380  reader.setErrorHandler(&handler);
1381 
1382  QString imageListXmlPath = m_project->imageDataRoot() + "/" + m_imageList->path() +
1383  "/images.xml";
1384  QFile file(imageListXmlPath);
1385 
1386  if (!file.open(QFile::ReadOnly)) {
1387  throw IException(IException::Io,
1388  QString("Unable to open [%1] with read access")
1389  .arg(imageListXmlPath),
1390  _FILEINFO_);
1391  }
1392 
1393  QXmlInputSource xmlInputSource(&file);
1394  if (!reader.parse(xmlInputSource))
1395  throw IException(IException::Io,
1396  tr("Failed to open image list XML [%1]").arg(imageListXmlPath),
1397  _FILEINFO_);
1398  }
1399 
1400  return XmlStackedHandler::endElement(namespaceURI, localName, qName);
1401  }
1402 }
QVariant getValue(int property) const
Get a property&#39;s associated data.
bool supports(int property)
Support may come later, please make sure you are connected to the supportAdded signal.
Image * takeLast()
Removes and returns the last image.
Definition: ImageList.cpp:419
QString path() const
Get the path to the images in the image list (relative to project root).
Definition: ImageList.cpp:730
True if the cube should show a fill area if possible (bool)
QStringList saveAndToggleShowDNs()
Changes the visibility of the DNs of the first image in the image list and synchronizes the visibilit...
Definition: ImageList.cpp:1214
void push_back(Image *const &value)
Appends an image to the end of the image list.
Definition: ImageList.cpp:271
CopyImageDataFunctor(const Project *project, FileName newProjectRoot)
Constructor for CopyImageDataFunctor.
Definition: ImageList.cpp:857
Internalizes a list of images and allows for operations on the entire list.
Definition: ImageList.h:44
ImageList & operator<<(const QList< Image * > &other)
Appends a list of images to the end of the image list.
Definition: ImageList.cpp:474
The main project for cnetsuite.
Definition: Project.h:105
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
Handle an XML end element.
Definition: ImageList.cpp:1373
int removeAll(Image *const &value)
Removes all occurances of an image.
Definition: ImageList.cpp:300
QStringList saveAndApplyRandomColor()
Sets the color values of every image to a random color.
Definition: ImageList.cpp:1146
void showRandomColor()
This applies a new semi-random color to every image&#39;s display property for every image in this image ...
Definition: ImageList.cpp:1200
This functor is used for copying the images between two projects quickly.
Definition: ImageList.h:155
File name manipulation and expansion.
Definition: FileName.h:111
void deleteFromDisk()
Delete the image data from disk.
Definition: Image.cpp:519
void add(const QString &filename, bool def2filename=false)
Adds a new filename / serial number pair to the SerialNumberList.
void deleteFromDisk(Project *project)
Delete all of the contained Images from disk.
Definition: ImageList.cpp:742
Show or hide each image&#39;s fill area.
void applyShowLabel(QStringList showLabelValues)
Sets the visibility of the display names of the images in the image list based on a list of values...
Definition: ImageList.cpp:960
QString name() const
Get the human-readable name of this image list.
Definition: ImageList.cpp:719
QStringList saveAndToggleShowOutline()
Changes the visibility of the outline of the first image in the image list and synchronizes the visib...
Definition: ImageList.cpp:1298
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:108
void applyColors(QStringList colorValues, int column=0)
Sets the colors values of the images based on a list of values.
Definition: ImageList.cpp:940
SerialNumberList * serialNumberList()
Creates a SerialNumberList from the image list.
Definition: ImageList.cpp:132
void setShowDNs(bool)
Change the visibility of DNs associated with this cube.
~CopyImageDataFunctor()
Destructor for CopyImageDataFunctor.
Definition: ImageList.cpp:878
True if the cube should be outlined (bool)
bool removeOne(Image *const &value)
Removes the first occurance of an image.
Definition: ImageList.cpp:355
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Handle an XML start element.
Definition: ImageList.cpp:1339
void removeAt(int i)
Removes the image at an index.
Definition: ImageList.cpp:318
QString m_path
This stores the directory name that contains the images in this image list.
Definition: ImageList.h:239
QAction * createWorkOrder(Project *project, ImageListActionWorkOrder::Action action)
Creates an ImageListActionWorkOrder and sets the image list as the data for the work order...
Definition: ImageList.h:185
A type of error that occurred when performing an actual I/O operation.
Definition: IException.h:163
QString m_name
This stores the image list&#39;s name.
Definition: ImageList.h:227
CopyImageDataFunctor & operator=(const CopyImageDataFunctor &rhs)
Assignment operator for CopyImageDataFunctor.
Definition: ImageList.cpp:903
~ImageList()
Destructor.
Definition: ImageList.cpp:123
True if the cube should show DN values if possible (bool)
bool askAlpha(int *alphaResult) const
Prompts the user for an alpha value.
Definition: ImageList.cpp:1041
True if the cube should show its display name (bool)
void prepend(Image *const &value)
Inserts an image at the beginning of the image list.
Definition: ImageList.cpp:257
QDebug operator<<(QDebug dbg, const Isis::Angle &angleToPrint)
Display an Angle for a debugging statement.
Definition: Angle.cpp:379
void copyToNewProjectRoot(const Project *project, FileName newProjectRoot)
Copy the cub/ecub files associated with this image into the new project.
Definition: Image.cpp:483
QList< QAction * > supportedActions(Project *project=NULL)
Gets a list of pre-connected actions that have to do with display.
Definition: ImageList.cpp:557
ImageList & operator+=(const QList< Image * > &other)
Appends a list of images to the end of the image list.
Definition: ImageList.cpp:436
Change the alpha values of the image list.
Set each image in the list to a random color.
This is the GUI communication mechanism for cubes.
void push_front(Image *const &value)
Prepends an image to the beginning of the image list.
Definition: ImageList.cpp:285
void setShowLabel(bool)
Change the visibility of the display name associated with this cube.
const Project * m_project
This stores the name of the project that is going to be copied to.
Definition: ImageList.h:169
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:38
void swap(QList< Image * > &other)
Swaps the image list with another list of images.
Definition: ImageList.cpp:373
void applyShowFill(QStringList showFillValues)
Sets the visibility of the fill areas of the images in the image list based on a list of values...
Definition: ImageList.cpp:980
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Convert this image list into XML format for saving/restoring capabilities.
Definition: ImageList.cpp:779
void clear()
Clears the image list.
Definition: ImageList.cpp:174
This represents a cube in a project-based GUI interface.
Definition: Image.h:91
void setColor(QColor newColor)
Change the color associated with this cube.
void removeFirst()
Removes the image at the front of the image list.
Definition: ImageList.cpp:329
void applyShowOutline(QStringList showOutlineValues)
Sets the visibility of the outlines of the images in the image list based on a list of values...
Definition: ImageList.cpp:1018
void setPath(QString newPath)
Set the relative path (from the project root) to this image list&#39;s folder.
Definition: ImageList.cpp:709
ImageDisplayProperties * displayProperties()
Get the display (GUI) properties (information) associated with this image.
Definition: Image.cpp:285
QStringList saveAndApplyAlpha(int newAlpha)
Sets the alpha value of every image in the image list to a specificed value.
Definition: ImageList.cpp:1092
Image * takeAt(int i)
Removes the image at an index and returns it.
Definition: ImageList.cpp:391
void applyAlphas(QStringList alphaValues)
Sets the alpha values of the images based on a list of values.
Definition: ImageList.cpp:919
void append(Image *const &value)
Appends an image to the image list.
Definition: ImageList.cpp:150
Property
This is a list of properties and actions that are possible.
void setShowOutline(bool)
Change the visibility of the outline associated with this cube.
void askAndUpdateColor()
Prompt the user for a new color.
Definition: ImageList.cpp:1189
void insert(int i, Image *const &value)
Inserts an image into the image list at an index.
Definition: ImageList.cpp:226
Data ignored. Tells if the cube supports the zoomFit action.
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Write the Image properties out to an XML file.
Definition: Image.cpp:559
bool askNewColor(QColor *colorResult) const
Prompts the user for color values.
Definition: ImageList.cpp:1069
Data ignored. Tells if the cube supports the &quot;move*&quot; actions.
Image * takeFirst()
Removes and returns the first image.
Definition: ImageList.cpp:405
XmlHandler(ImageList *imageList, Project *project)
Create an XML Handler (reader) that can populate the Image list class data.
Definition: ImageList.cpp:1327
Change the color values of the image list.
void applyShowDNs(QStringList showDNsValues)
Sets the visibility of the DNs of the images in the image list based on a list of values...
Definition: ImageList.cpp:999
iterator erase(iterator pos)
Erases a single image from the image list.
Definition: ImageList.cpp:192
This class is used to read an images.xml file into an image list.
Definition: ImageList.h:123
QStringList saveAndToggleShowLabel()
Changes the visibility of the display name of the first image in the image list and synchronizes the ...
Definition: ImageList.cpp:1270
Isis exception class.
Definition: IException.h:99
FileName m_newProjectRoot
This stores the path to the root of the project that is going to be copied to.
Definition: ImageList.h:173
bool allSupport(ImageDisplayProperties::Property prop)
Check if all images in the image list support a display property.
Definition: ImageList.cpp:679
void askAndUpdateAlpha()
Prompt the user for a new alpha value.
Definition: ImageList.cpp:1176
The color of the cube, default randomized (QColor)
void removeLast()
Removes the image at the end of the image list.
Definition: ImageList.cpp:340
ImageList(QString name, QString path, QObject *parent=NULL)
Creates an image list from an image list name and path (does not read Images).
Definition: ImageList.cpp:52
static QString imageDataRoot(QString projectRoot)
Appends the root directory name &#39;images&#39; to the project .
Definition: Project.cpp:1260
Serial Number list generator.
ImageList & operator=(const QList< Image * > &rhs)
Assigns another list of images to the image list.
Definition: ImageList.cpp:511
void setName(QString newName)
Set the human-readable name of this image list.
Definition: ImageList.cpp:698
QString path() const
Returns the path.
Definition: FileName.cpp:88
his enables stack-based XML parsing of XML files.
QStringList saveAndToggleShowFill()
Changes the visibility of the fill area of the first image in the image list and synchronizes the vis...
Definition: ImageList.cpp:1242
QString imageDataRoot() const
Accessor for the root directory of the image data.
Definition: Project.cpp:1270
void * operator()(Image *const &imageToCopy)
Copies the cub/ecub files for an image into m_project.
Definition: ImageList.cpp:890
static QColor randomColor()
Creates and returns a random color for the intial color of the footprint polygon. ...
QStringList saveAndApplyColor(QColor newColor)
Sets the color values of every image to a specificed set of values.
Definition: ImageList.cpp:1119
Show or hide each image&#39;s display name.
void setShowFill(bool)
Change the visibility of the fill area associated with this cube.

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:20:10