Isis 3.0 Programmer Reference
Back | Home
ImageFileListWidget.cpp
1 #include "ImageFileListWidget.h"
2 
3 #include <iostream>
4 
5 #include <QAction>
6 #include <QApplication>
7 #include <QContextMenuEvent>
8 #include <QDebug>
9 #include <QFileDialog>
10 #include <QHBoxLayout>
11 #include <QLabel>
12 #include <QMenu>
13 #include <QPoint>
14 #include <QScrollArea>
15 #include <QSettings>
16 #include <QSize>
17 #include <QVBoxLayout>
18 #include <QXmlStreamWriter>
19 
20 #include "Directory.h"
21 #include "FileName.h"
22 #include "IException.h"
23 #include "ImageTreeWidget.h"
24 #include "ImageTreeWidgetItem.h"
25 #include "IString.h"
26 #include "ProgressBar.h"
27 #include "Project.h"
28 #include "PvlObject.h"
29 #include "TextFile.h"
30 #include "XmlStackedHandlerReader.h"
31 
32 namespace Isis {
33 
42  QWidget *parent) : QWidget(parent) {
43  m_directory = directory;
44  QHBoxLayout *layout = new QHBoxLayout();
45 
46  m_tree = new ImageTreeWidget(directory);
47  m_tree->setObjectName("Tree");
48  layout->addWidget(m_tree);
49 
50  layout->setContentsMargins(0, 0, 0, 0);
51 
52  setWhatsThis("This is the image file list. Opened "
53  "cubes show up here. You can arrange your cubes into groups (that you "
54  "name) to help keep track of them. Also, you can configure multiple "
55  "files at once. Finally, you can sort your files by any of the visible "
56  "columns (use the view menu to show/hide columns of data).");
57 
58  setLayout(layout);
59 
60  m_progress = new ProgressBar;
61  m_progress->setVisible(false);
62  }
63 
68  delete m_progress;
69  m_directory = NULL;
70  }
71 
78  return m_progress;
79  }
80 
89  if (pvl.name() == "ImageFileList") {
90  m_serialized.reset(new PvlObject(pvl));
91  ImageTreeWidgetItem::TreeColumn col =
92  ImageTreeWidgetItem::FootprintColumn;
93  while (col < ImageTreeWidgetItem::BlankColumn) {
94  IString key = ImageTreeWidgetItem::treeColumnToString(col) + "Visible";
95  key = key.Convert(" ", '_');
96 
97  if (pvl.hasKeyword(key.ToQt())) {
98  bool visible = toBool(pvl[key.ToQt()][0]);
99 
100  if (visible) {
101  m_tree->showColumn(col);
102  }
103  else {
104  m_tree->hideColumn(col);
105  }
106  }
107 
108  col = (ImageTreeWidgetItem::TreeColumn)(col + 1);
109  }
110 
111  m_tree->updateViewActs();
112  m_tree->sortItems(pvl["SortColumn"], Qt::AscendingOrder);
113 
114  QList<QTreeWidgetItem *> allCubes;
115 
116  // Take all of the cubes out of the tree
117  while (m_tree->topLevelItemCount() > 0) {
118  QTreeWidgetItem *group = m_tree->takeTopLevelItem(0);
119  allCubes.append(group->takeChildren());
120 
121  delete group;
122  group = NULL;
123  }
124 
125  // Now re-build the tree items
126  for (int cubeGrp = 0; cubeGrp < pvl.objects(); cubeGrp ++) {
127  PvlObject &cubes = pvl.object(cubeGrp);
128 
129  QTreeWidgetItem *newCubeGrp = m_tree->addGroup("", cubes.name());
130 
131  if (cubes.hasKeyword("Expanded")) {
132  bool expanded = (cubes["Expanded"][0] != "No");
133  newCubeGrp->setExpanded(expanded);
134  }
135  }
136 
137  if (allCubes.size()) {
138  m_tree->addGroup("", "Unknown")->addChildren(allCubes);
139  }
140  }
141  else {
142  throw IException(IException::Io, "Unable to read image file's "
143  "list widget settings from Pvl", _FILEINFO_);
144  }
145  }
146 
153  PvlObject output("ImageFileList");
154 
155  ImageTreeWidgetItem::TreeColumn col =
156  ImageTreeWidgetItem::FootprintColumn;
157  while (col < ImageTreeWidgetItem::BlankColumn) {
158  IString key = ImageTreeWidgetItem::treeColumnToString(col) + "Visible";
159  key = key.Convert(" ", '_');
160  bool visible = !m_tree->isColumnHidden(col);
161 
162  output += PvlKeyword(key.ToQt(), toString((int)visible));
163  col = (ImageTreeWidgetItem::TreeColumn)(col + 1);
164  }
165 
166  output += PvlKeyword("SortColumn", toString(m_tree->sortColumn()));
167 
168  // Now store groups and the cubes that are in those groups
169  for (int i = 0; i < m_tree->topLevelItemCount(); i++) {
170  QTreeWidgetItem *group = m_tree->topLevelItem(i);
171  PvlObject cubeGroup(
172  group->text(ImageTreeWidgetItem::NameColumn));
173  cubeGroup += PvlKeyword("Expanded", group->isExpanded() ? "Yes" : "No");
174 
175  for (int j = 0; j < group->childCount(); j++) {
176  QTreeWidgetItem *item = group->child(j);
177 
178  if (item->type() == QTreeWidgetItem::UserType) {
179  ImageTreeWidgetItem *cubeItem = (ImageTreeWidgetItem *)item;
180 
181  cubeGroup += PvlKeyword("Image", cubeItem->image()->id());
182  }
183  }
184 
185  output += cubeGroup;
186  }
187 
188  return output;
189  }
190 
197  xmlReader->pushContentHandler(new XmlHandler(this));
198  }
199 
209  return m_tree->actions();
210  }
211 
219  return m_tree->getViewActions();
220  }
221 
229  QList<QAction *> exportActs;
230 
231  QAction *saveList = new QAction(this);
232  saveList->setText(
233  "Save Entire Cube List (ordered by &file list/groups)...");
234  connect(saveList, SIGNAL(triggered()), this, SLOT(saveList()));
235 
236  exportActs.append(saveList);
237 
238  return exportActs;
239  }
240 
247  QScrollArea *longHelpWidgetScrollArea = new QScrollArea;
248 
249  QWidget *longHelpWidget = new QWidget;
250  longHelpWidgetScrollArea->setWidget(longHelpWidget);
251 
252  QVBoxLayout *longHelpLayout = new QVBoxLayout;
253  longHelpLayout->setSizeConstraint(QLayout::SetFixedSize);
254  longHelpWidget->setLayout(longHelpLayout);
255 
256  QLabel *title = new QLabel("<h2>Image File List</h2>");
257  longHelpLayout->addWidget(title);
258 
259  QPixmap preview;
260  if (!fileListContainer) {
261 // QWeakPointer<ImageFileListWidget> tmp = new ImageFileListWidget;
262 // tmp.data()->resize(QSize(500, 200));
263 // preview = tmp.data().grab();
264 // delete tmp.data();
266  tmp->resize(QSize(500, 200));
267  preview = tmp->grab();
268  delete tmp;
269  }
270  else {
271  QPixmap previewPixmap = fileListContainer->grab().scaled(
272  QSize(500, 200), Qt::KeepAspectRatio, Qt::SmoothTransformation);
273 
274  QLabel *previewWrapper = new QLabel;
275  previewWrapper->setPixmap(previewPixmap);
276  longHelpLayout->addWidget(previewWrapper);
277  }
278 
279  QLabel *previewWrapper = new QLabel;
280  previewWrapper->setPixmap(preview);
281  longHelpLayout->addWidget(previewWrapper);
282 
283  QLabel *overview = new QLabel(tr("The mosaic file list is designed to help "
284  "to organize your files within the %1 project. The file list supports changing multiple "
285  "files simultaneously using the right-click menus after selecting "
286  "several images or groups.<br>"
287  "<h3>Groups</h3>"
288  "<p>Every cube must be inside of a group. These groups can be "
289  "renamed by double clicking on them. To move a cube between groups, "
290  "click and drag it to the group you want it in. This works "
291  "for multiple cubes also. You can change all of the cubes in a "
292  "group by right clicking on the group name. You can add a group "
293  "by right clicking in the white space below the last cube or on "
294  "an existing group.</p>"
295  "<h3>Columns</h3>"
296  "Show and hide columns by using the view menu. These "
297  "columns show relevant data about the cube, including statistical "
298  "information. Some of this information will be blank if you do "
299  "not run the application, <i>camstats</i>, before opening the cube."
300  "<h3>Sorting</h3>"
301  "Sort cubes within each group in ascending or descending order "
302  "by clicking on the column "
303  "title of the column that you want to sort on. Clicking on the "
304  "title again will reverse the sorting order. You can also drag and "
305  "drop a cube between two other cubes to change where it is in the "
306  "list.").arg(QApplication::applicationName()));
307  overview->setWordWrap(true);
308 
309  longHelpLayout->addWidget(overview);
310  longHelpLayout->addStretch();
311 
312  return longHelpWidgetScrollArea;
313  }
314 
321  m_progress->setText("Loading file list");
322  m_progress->setRange(0, images->size() - 1);
323  m_progress->setValue(0);
324  m_progress->setVisible(true);
325 
326  QList<QTreeWidgetItem *> selected = m_tree->selectedItems();
327 
328  ImageList alreadyViewedImages = m_tree->imagesInView();
329 
330 
331  // Expanded states are forgotten when removed from the tree; hence the bool.
333 
334 
335  // It's very slow to add/insertChild() on tree items when they are in the tree, so let's
336  // take them out of the tree, call add/insertChild() over and over, then give the
337  // groups (tree items) back to the tree. Expanded states are lost... so save/restore them
338  QVariant expandedStates = saveExpandedStates(m_tree->invisibleRootItem());
339  while (m_tree->topLevelItemCount()) {
340  groups.append(m_tree->takeTopLevelItem(0));
341  }
342 
343  QTreeWidgetItem *selectedGroup = NULL;
344 
345  foreach (Image *image, *images) {
346  if (alreadyViewedImages.indexOf(image) == -1) {
348 
349  if (!m_serialized.isNull()) {
350  pos = find(image);
351  }
352 
353  QTreeWidgetItem *newImageItem = m_tree->prepCube(images, image);
354 
355  if (!pos.isValid()) {
356  if (m_tree->groupInList(selected)) {
357  QListIterator<QTreeWidgetItem *> it(selected);
358  while (it.hasNext() && !selectedGroup) {
359  QTreeWidgetItem *item = it.next();
360  if (item->data(0, Qt::UserRole).toInt() == ImageTreeWidget::ImageGroupType) {
361  selectedGroup = item;
362  }
363  }
364  }
365 
366  if (!selectedGroup) {
367  QTreeWidgetItem *imageListNameItem = NULL;
368  QString groupName;
369 
370  if (images->name().isEmpty()) {
371  imageListNameItem = m_tree->invisibleRootItem();
372  groupName = QString("Group %1").arg(groups.count() + 1);
373  }
374  else {
375  for (int i = 0; !imageListNameItem && i < groups.count(); i++) {
376  QTreeWidgetItem *group = groups[i];
377  if (group->data(0, Qt::UserRole).toInt() == ImageTreeWidget::ImageListNameType &&
378  group->text(0) == images->name()) {
379  imageListNameItem = group;
380  }
381  }
382 
383  if (!imageListNameItem) {
384  imageListNameItem = m_tree->createImageListNameItem(images->name());
385  groups.append(imageListNameItem);
386  }
387  }
388 
389  selectedGroup = m_tree->createGroup(imageListNameItem, groupName);
390  }
391 
392  selectedGroup->addChild(newImageItem);
393  }
394  else {
395  QTreeWidgetItem *groupItem = groups[pos.group()];
396  if (groupItem->childCount() < pos.index())
397  groupItem->addChild(newImageItem);
398  else
399  groupItem->insertChild(pos.index(), newImageItem);
400  }
401  }
402 
403  m_progress->setValue(m_progress->value() + 1);
404  }
405 
406  foreach (QTreeWidgetItem *group, groups) {
407  m_tree->addTopLevelItem(group);
408  }
409  restoreExpandedStates(expandedStates, m_tree->invisibleRootItem());
410 
411  if (selectedGroup)
412  selectedGroup->setSelected(true);
413 
414  m_tree->refit();
415  m_progress->setVisible(false);
416  }
417 
424  void ImageFileListWidget::contextMenuEvent(QContextMenuEvent *event) {
425  QMenu menu;
426 
427  QList<QAction *> actions = m_tree->getViewActions();
428 
429  foreach (QAction *act, actions) {
430  if (act) {
431  menu.addAction(act);
432  }
433  else {
434  menu.addSeparator();
435  }
436  }
437 
438  menu.exec(event->globalPos());
439  }
440 
445  QString output =
446  QFileDialog::getSaveFileName((QWidget *)parent(),
447  "Choose output file",
448  QDir::currentPath() + "/files.lis",
449  QString("List File (*.lis);;Text File (*.txt);;All Files (*.*)"));
450  if (output.isEmpty()) return;
451 
452  TextFile file(output, "overwrite");
453 
454  for (int i = 0; i < m_tree->topLevelItemCount(); i++) {
455  QTreeWidgetItem *group = m_tree->topLevelItem(i);
456 
457  for (int j = 0; j < group->childCount(); j++) {
458  QTreeWidgetItem *item = group->child(j);
459 
460  if (item->type() == QTreeWidgetItem::UserType) {
461  ImageTreeWidgetItem *cubeItem = (ImageTreeWidgetItem *)item;
462  file.PutLine(cubeItem->image()->fileName());
463  }
464  }
465  }
466  }
467 
476  QString id = image->id();
477 
479  for (int objIndex = 0; !result.isValid() && objIndex < m_serialized->objects(); objIndex++) {
480  PvlObject &obj = m_serialized->object(objIndex);
481 
482  int imageKeyOffset = 0;
483  for (int fileKeyIndex = 0;
484  !result.isValid() && fileKeyIndex < obj.keywords();
485  fileKeyIndex++) {
486  PvlKeyword &key = obj[fileKeyIndex];
487 
488  if (key.isNamed("Image")) {
489  if (key[0] == id) {
490  result = ImageTreeWidget::ImagePosition(objIndex, imageKeyOffset);
491  }
492  else {
493  imageKeyOffset++;
494  }
495  }
496  }
497  }
498 
499  return result;
500  }
501 
508  void ImageFileListWidget::restoreExpandedStates(QVariant expandedStates, QTreeWidgetItem *item) {
509  QMap<QString, QVariant> states = expandedStates.toMap();
510 
511  if (states.contains("Expanded")) {
512  item->setExpanded(states["Expanded"].toBool());
513  }
514  else {
515  item->setExpanded(true);
516  }
517 
518  QList<QVariant> childrenStates = states["Children"].toList();
519 
520  int i = 0;
521  while (i < item->childCount() && i < childrenStates.count()) {
522  restoreExpandedStates(childrenStates[i], item->child(i));
523  i++;
524  }
525 
526  while (i < item->childCount()) {
527  restoreExpandedStates(QVariant(), item->child(i));
528  i++;
529  }
530  }
531 
541 
542  result["Expanded"] = item->isExpanded();
543 
544  if (item->childCount()) {
545  QList<QVariant> childrenStates;
546 
547  for (int i = 0; i < item->childCount(); i++) {
548  childrenStates.append(saveExpandedStates(item->child(i)));
549  }
550 
551  result["Children"] = childrenStates;
552  }
553 
554  return result;
555  }
556 
565  void ImageFileListWidget::save(QXmlStreamWriter &stream, Project *project,
566  FileName newProjectRoot) const {
567  stream.writeStartElement("imageFileList");
568 
569  // Write QSettings
570  stream.writeStartElement("widgetGeometry");
571 // QString geom = saveGeometry();
572 // //qDebug()<<"ImageFileListWidget::save geometry = "<<geom;
573 // stream.writeAttribute("value", saveGeometry());
574 // stream.writeEndElement();
575 
576 // stream.writeStartElement("geometry");
577 // //qDebug()<<"ImageFileListWidget::save Geometry = "<<geometry();
578 // //qDebug()<<"ImageFileListWidget::save saveGeometry = "<<saveGeometry();
579 // stream.writeAttribute("x", QString::number(pos().x()));
580 // stream.writeAttribute("y", QString::number(pos().y()));
581 // stream.writeEndElement();
582 //
583 // stream.writeStartElement("position");
584 // //qDebug()<<"ImageFileListWidget::save Position = "<<QVariant(pos()).toString();
585 // stream.writeAttribute("x", QString::number(pos().x()));
586 // stream.writeAttribute("y", QString::number(pos().y()));
587 // stream.writeEndElement();
588 //
589 // stream.writeStartElement("size");
590 // //qDebug()<<"ImageFileListWidget::save Size = "<<size();
591 // stream.writeAttribute("width", QString::number(size().width()));
592 // stream.writeAttribute("height", QString::number(size().height()));
593 // stream.writeEndElement();
594 // stream.writeEndElement();
595 
596 
597  ImageTreeWidgetItem::TreeColumn col =
598  ImageTreeWidgetItem::FootprintColumn;
599  while (col < ImageTreeWidgetItem::BlankColumn) {
600  bool visible = !m_tree->isColumnHidden(col);
601  bool sorted = (m_tree->sortColumn() == col);
602 
603  stream.writeStartElement("column");
604  stream.writeAttribute("name", ImageTreeWidgetItem::treeColumnToString(col));
605  stream.writeAttribute("visible", (visible? "true" : "false"));
606  stream.writeAttribute("sorted", (sorted? "true" : "false"));
607  stream.writeEndElement();
608 
609  col = (ImageTreeWidgetItem::TreeColumn)(col + 1);
610  }
611 
612  // Now store groups and the cubes that are in those groups
613  save(stream, NULL);
614 
615  stream.writeEndElement();
616  }
617 
625  void ImageFileListWidget::save(QXmlStreamWriter &stream, QTreeWidgetItem *itemToWrite) const {
626  bool done = false;
627 
628  // Start the element - image or group with attributes
629  if (!itemToWrite) {
630  stream.writeStartElement("treeLayout");
631  }
632  else if (itemToWrite->type() == QTreeWidgetItem::UserType) {
633  ImageTreeWidgetItem *imageItemToWrite = (ImageTreeWidgetItem *)itemToWrite;
634 
635  stream.writeStartElement("image");
636  stream.writeAttribute("id", imageItemToWrite->image()->id());
637  }
638  else {
639  bool groupIsImageList =
640  (itemToWrite->data(0, Qt::UserRole).toInt() == ImageTreeWidget::ImageListNameType);
641 
642  stream.writeStartElement("group");
643  stream.writeAttribute("name", itemToWrite->text(ImageTreeWidgetItem::NameColumn));
644  stream.writeAttribute("expanded", itemToWrite->isExpanded() ? "true" : "false");
645  stream.writeAttribute("isImageList", groupIsImageList? "true" : "false");
646  }
647 
648  // Write any child XML elements (groups in groups)
649  int i = 0;
650  while (!done) {
651  QTreeWidgetItem *childItemToWrite = NULL;
652 
653  if (itemToWrite == NULL && i < m_tree->topLevelItemCount()) {
654  childItemToWrite = m_tree->topLevelItem(i);
655  }
656  else if (itemToWrite != NULL && i < itemToWrite->childCount()) {
657  childItemToWrite = itemToWrite->child(i);
658  }
659 
660  if (childItemToWrite) {
661  save(stream, childItemToWrite);
662  }
663 
664  done = (childItemToWrite == NULL);
665  i++;
666  }
667 
668  // Close the initial image or group element
669  stream.writeEndElement();
670  }
671 
678  m_fileList = fileList;
679  m_currentImageList = NULL;
680  m_currentImageListItem = NULL;
681  m_currentGroup = NULL;
682  }
683 
688  }
689 
701  bool ImageFileListWidget::XmlHandler::startElement(const QString &namespaceURI,
702  const QString &localName, const QString &qName, const QXmlAttributes &atts) {
703  bool result = XmlStackedHandler::startElement(namespaceURI, localName, qName, atts);
704  /* //tjw
705  if (result) {
706 
707 // if (localName == "geometry") {
708 // QByteArray
709 // restoreGeometry(atts.value("value").toLatin1());
710 // }
711 
712  if (localName == "position") {
713  QPoint pos = QPoint(atts.value("x").toInt(), atts.value("y").toInt());
714  //qDebug()<<" ::startElement pos = "<<pos;
715  m_fileList->move(pos);
716  }
717  else if (localName == "size") {
718  QSize size = QSize(atts.value("width").toInt(), atts.value("height").toInt());
719  //qDebug()<<" ::startElement size = "<<size;
720  m_fileList->resize(size);
721  }
722  else if (localName == "column") {
723  QString colName = atts.value("name");
724  QString colVisibleStr = atts.value("visible");
725  QString colSortedStr = atts.value("sorted");
726 
727 
728  ImageTreeWidgetItem::TreeColumn col =
729  ImageTreeWidgetItem::NameColumn;
730  while (col < ImageTreeWidgetItem::BlankColumn) {
731  QString curColName = ImageTreeWidgetItem::treeColumnToString(col);
732 
733  if (curColName == colName) {
734  if (colVisibleStr != "false") {
735  m_fileList->m_tree->showColumn(col);
736  }
737  else {
738  m_fileList->m_tree->hideColumn(col);
739  }
740 
741  if (colSortedStr == "true") {
742  m_fileList->m_tree->sortItems(col, Qt::AscendingOrder);
743  }
744  }
745 
746  col = (ImageTreeWidgetItem::TreeColumn)(col + 1);
747  }
748  }
749 
750  else if (localName == "group") {
751  if (atts.value("isImageList") == "true") {
752  if (!m_currentImageList) {
753  QString name = atts.value("name");
754  m_currentImageListItem = m_fileList->m_tree->createImageListNameItem(name);
755  m_currentImageList = m_fileList->m_directory->project()->imageList(name);
756  m_fileList->m_tree->addTopLevelItem(m_currentImageListItem);
757  m_currentImageListItem->setExpanded(true);
758  }
759  }
760  else {
761  m_currentGroup = m_fileList->m_tree->createGroup(m_currentImageListItem,
762  atts.value("name"));
763  }
764  }
765 
766  else if (localName == "image" && m_currentGroup) {
767  Image *image = m_fileList->m_directory->project()->image(atts.value("id"));
768  m_currentGroup->addChild(m_fileList->m_tree->prepCube(m_currentImageList, image));
769  }
770 
771  }
772  */
773 
774  return result;
775  }
776 
787  bool ImageFileListWidget::XmlHandler::endElement(const QString &namespaceURI,
788  const QString &localName, const QString &qName) {
789  bool result = XmlStackedHandler::endElement(namespaceURI, localName, qName);
790 
791  if (result) {
792  if (localName == "group") {
793  if (m_currentGroup) {
794  m_currentGroup = NULL;
795  }
796  else {
797  m_currentImageList = NULL;
798  m_currentImageListItem = NULL;
799  }
800  }
801  }
802 
803  return result;
804  }
805 }
PvlObject & object(const int index)
Return the object at the specified index.
Definition: PvlObject.cpp:460
QPointer< ProgressBar > m_progress
The ProgressBar of the ImageFileListWidget Serialized (file) version of this ob...
Internalizes a list of images and allows for operations on the entire list.
Definition: ImageList.h:44
The main project for cnetsuite.
Definition: Project.h:105
QString id() const
Get a unique, identifying string associated with this image.
Definition: Image.cpp:394
ImageFileListWidget * m_fileList
The widget we are working with.
QString ToQt() const
Retuns the object string as a QString.
Definition: IString.cpp:884
ImageList * m_currentImageList
The list of images being worked on.
XmlHandler(ImageFileListWidget *fileList)
Creates a XmlHandler for fileList.
bool isNamed(QString name) const
Determines whether two PvlKeywords have the same name or not.
Definition: PvlKeyword.h:126
File name manipulation and expansion.
Definition: FileName.h:111
void save(QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const
This method saves the FootprintColumns in the project and the settings associated with every column...
QString fileName() const
Get the file name of the cube that this image represents.
Definition: Image.cpp:305
PvlObject toPvl() const
This method writes the state of this class to a pvl.
int keywords() const
Returns the number of keywords contained in the PvlContainer.
Definition: PvlContainer.h:101
QString name() const
Get the human-readable name of this image list.
Definition: ImageList.cpp:719
ImageFileListWidget(Directory *directory=0, QWidget *parent=0)
Constructor.
void load(XmlStackedHandlerReader *xmlReader)
This method pushes a new XmlHandler into the parser stack.
QTreeWidgetItem * m_currentGroup
The group of cubes being worked on.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:226
Directory * m_directory
The directory of the project.
A type of error that occurred when performing an actual I/O operation.
Definition: IException.h:163
virtual ~ImageFileListWidget()
Destructor.
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
This method calls XmlStackedHandler&#39;s startElement() and retrieves attributes from atts according to ...
void saveList()
This method saves the list to the choosen output file.
bool hasKeyword(const QString &kname, FindOptions opts) const
See if a keyword is in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within ...
Definition: PvlObject.cpp:207
void restoreExpandedStates(QVariant expandedStates, QTreeWidgetItem *item)
This method returns the QTreeWidgetItem to it&#39;s expanded state.
QList< QAction * > getExportActions()
This method creates a new QAction which is connected and when triggered will save the cube list...
QProgressBar * getProgress()
This method returns the progress bar.
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:38
IString Convert(const std::string &listofchars, const char &to)
Returns the string with all occurrences of any character in the &quot;from&quot; argument converted to the &quot;to&quot;...
Definition: IString.cpp:1211
void contextMenuEvent(QContextMenuEvent *event)
This method takes an event and gets all of the FootprintColumns, adds them to the menu...
int objects() const
Returns the number of objects.
Definition: PvlObject.h:231
A single keyword-value pair.
Definition: PvlKeyword.h:98
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
This method calls XmlStackedHandler&#39;s endElement() and dereferences pointers according to the value o...
void addImages(ImageList *images)
This method adds the new images to the tree.
This represents a cube in a project-based GUI interface.
Definition: Image.h:91
QList< QAction * > getViewActions()
This method calls ImageTreeWidget::getViewActions() which returns a list of FootprintColumns.
QTreeWidgetItem * m_currentImageListItem
The image being worked on.
Provides access to sequential ASCII stream I/O.
Definition: TextFile.h:54
static QWidget * getLongHelp(QWidget *fileListContainer=NULL)
This method creates a QWidget that displays a long help message explaining the tool.
A colored, grouped cube list.
bool toBool(const QString &string)
Global function to convert from a string to a boolean.
Definition: IString.cpp:53
void fromPvl(PvlObject &pvl)
This method loads the state of this class from the pvl.
QList< QAction * > actions()
This method calls ImageTreeWidget::actions() which sets up a QAction that sets a default for the file...
void PutLine(const QString &line)
Writes string to file and appends a &#39;newline&#39; string.
Definition: TextFile.cpp:524
Isis exception class.
Definition: IException.h:99
Adds specific functionality to C++ strings.
Definition: IString.h:179
QProgressBar with customizable text.
Definition: ProgressBar.h:15
QVariant saveExpandedStates(QTreeWidgetItem *item)
This method saves the the expanded state of item.
ImageTreeWidget * m_tree
Tree item associated with this mosaic item.
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
his enables stack-based XML parsing of XML files.
ImageTreeWidget::ImagePosition find(const Image *image) const
This method takes an image and finds it&#39;s position.
QString name() const
Returns the container name.
Definition: PvlContainer.h:78

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:04