Isis Developer Reference
ImageTreeWidget.h
Go to the documentation of this file.
1 #ifndef ImageTreeWidget_H
2 #define ImageTreeWidget_H
3 
4 #include <QPointer>
5 #include <QTreeWidget>
6 
7 class QProgressBar;
8 
9 namespace Isis {
10  class Directory;
11  class DisplayProperties;
12  class Image;
13  class ImageList;
14  class ImageTreeWidgetItem;
15  class ProgressBar;
16 
42  class ImageTreeWidget : public QTreeWidget {
43  Q_OBJECT
44 
45  public:
46 
50  };
51 
52  ImageTreeWidget(Directory *directory = 0, QWidget *parent = 0);
53  virtual ~ImageTreeWidget();
54 
56 
57  QTreeWidgetItem *addGroup(QString imageListName, QString groupName = "", int index = -1);
58 
59  QTreeWidgetItem *createGroup(QTreeWidgetItem *imageListItem, QString groupName = "",
60  int index = -1);
62 
63  void refit();
64 
65  void disableSort();
67 
70  void updateViewActs();
71 
72  ImageTreeWidgetItem *prepCube(ImageList *imageList, Image *image);
73 
75 
76  public:
82  class ImagePosition {
83  public:
84  ImagePosition();
85  ImagePosition(int outerIndex, int innerIndex);
86  ImagePosition(const ImagePosition &other);
87 
88  virtual ~ImagePosition();
89 
90  void setPosition(int outerIndex, int innerIndex);
91 
92  int group() const;
93  int index() const;
94  bool isValid() const;
95 
96  void swap(ImagePosition &other);
97 
98  bool operator<(const ImagePosition &rhs);
100 
101  private:
102  void init();
103 
104  private:
105  int m_group;
106  int m_index;
107  };
108 
109  signals:
112 
113  protected:
114  void dropEvent(QDropEvent *event);
115  void mousePressEvent(QMouseEvent *event);
116  void contextMenuEvent(QContextMenuEvent *event);
117 
118  private slots:
120  void deleteSelectedGroups();
121  void imageDeleted(QObject *image);
122  void onItemChanged(QTreeWidgetItem *, int);
123  void onSelectionChanged();
124  void onQueuedReadDisplayProperties();
125  void onQueuedSelectionChanged();
126  void propertiesChanged(DisplayProperties *);
127  void renameSelectedGroup();
128  void requestCloseSelected();
129  void toggleColumnVisible();
130  void updateDragAndDropability();
131  void setDefaultFileListCols();
132 
133  private:
134  bool mosaicItemInList(QList<QTreeWidgetItem *>);
135  ImageList selectedDisplays();
136 
137  QTreeWidgetItem *imageListTreeItem(QString imageListName);
139  ImageTreeWidgetItem *treeItem(Image *);
140 
141  Directory *m_directory;
142  QList<QAction *> m_viewActs;
143  QPointer<QAction> m_setFileListColsAct;
144  QMap<DisplayProperties *, ImageTreeWidgetItem *> m_displayPropsToTreeItemLookup;
145  bool m_queuedSelectionChanged;
146 
147  QList<ImageTreeWidgetItem *> m_queuedReadDisplayPropertiesItems;
148  };
149 };
150 
151 #endif
152 
QWidget
QProgressBar
Isis::ImageTreeWidgetItem::PhaseAngleColumn
@ PhaseAngleColumn
Definition: ImageTreeWidgetItem.h:45
Isis::ImageTreeWidgetItem
Definition: ImageTreeWidgetItem.h:20
Isis::IException::print
void print() const
Prints a string representation of this exception to stderr.
Definition: IException.cpp:445
Isis::ImageTreeWidget::ImagePosition::operator<
bool operator<(const ImagePosition &rhs)
Definition: ImageTreeWidget.cpp:395
Isis::Directory
Definition: Directory.h:271
Isis::ImageTreeWidget::ImageListNameType
@ ImageListNameType
Definition: ImageTreeWidget.h:49
Isis::ImageTreeWidget::enqueueReadDisplayProperties
void enqueueReadDisplayProperties(ImageTreeWidgetItem *)
Definition: ImageTreeWidget.cpp:214
QList< QAction * >
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::ImageTreeWidgetItem::EmissionAngleColumn
@ EmissionAngleColumn
Definition: ImageTreeWidgetItem.h:43
Isis::ImageTreeWidget::ImagePosition::index
int index() const
Definition: ImageTreeWidget.cpp:379
Isis::ImageTreeWidgetItem::LabelColumn
@ LabelColumn
Definition: ImageTreeWidgetItem.h:40
QMenu
Directory.h
ImageTreeWidgetItem.h
Isis::ImageTreeWidgetItem::BlankColumn
@ BlankColumn
Definition: ImageTreeWidgetItem.h:51
Isis::Directory::supportedActions
QList< QAction * > supportedActions(DataType data)
Returns a list of supported actions for a WorkOrder.
Definition: Directory.h:345
Isis::ImageTreeWidgetItem::ImageColumn
@ ImageColumn
Definition: ImageTreeWidgetItem.h:39
Isis::ImageTreeWidget::updateViewActs
void updateViewActs()
Definition: ImageTreeWidget.cpp:247
ImageDisplayProperties.h
Isis::ImageList::append
void append(Image *const &value)
Appends an image to the image list.
Definition: ImageList.cpp:153
Isis::ImageTreeWidget::createImageListNameItem
QTreeWidgetItem * createImageListNameItem(QString name)
Definition: ImageTreeWidget.cpp:173
QTreeWidget
Isis::DisplayProperties
Definition: DisplayProperties.h:34
Isis::ImageTreeWidget::ImagePosition::ImagePosition
ImagePosition()
Definition: ImageTreeWidget.cpp:341
QTreeWidgetItem
Isis::ImageTreeWidget::queueReadDisplayProperties
void queueReadDisplayProperties()
Isis::ImageTreeWidget::queueSelectionChanged
void queueSelectionChanged()
Isis::Directory::project
Project * project() const
Gets the Project for this directory.
Definition: Directory.cpp:1311
Image.h
Isis::ImageTreeWidgetItem::treeColumnToString
static QString treeColumnToString(TreeColumn)
Definition: ImageTreeWidgetItem.cpp:143
Isis::ImageTreeWidget::~ImageTreeWidget
virtual ~ImageTreeWidget()
Definition: ImageTreeWidget.cpp:105
Isis::ImageTreeWidget::ImagePosition::~ImagePosition
virtual ~ImagePosition()
Definition: ImageTreeWidget.cpp:358
QStringList
Isis::ImageTreeWidgetItem::LineResolutionColumn
@ LineResolutionColumn
Definition: ImageTreeWidgetItem.h:48
Isis::Project
The main project for ipce.
Definition: Project.h:289
Isis::ImageList
Internalizes a list of images and allows for operations on the entire list.
Definition: ImageList.h:55
Isis::ImageTreeWidgetItem::IncidenceAngleColumn
@ IncidenceAngleColumn
Definition: ImageTreeWidgetItem.h:44
Isis::ImageTreeWidget::ImagePosition
Definition: ImageTreeWidget.h:82
Isis::ImageTreeWidget::ImagePosition::operator=
ImagePosition & operator=(const ImagePosition &rhs)
Definition: ImageTreeWidget.cpp:408
Isis::ImageTreeWidget::contextMenuEvent
void contextMenuEvent(QContextMenuEvent *event)
Definition: ImageTreeWidget.cpp:615
Isis::ImageTreeWidget::ImageGroupType
@ ImageGroupType
Definition: ImageTreeWidget.h:48
Isis::ImageTreeWidgetItem::AspectRatioColumn
@ AspectRatioColumn
Definition: ImageTreeWidgetItem.h:46
Isis::ImageTreeWidget::getViewActions
QList< QAction * > getViewActions()
Definition: ImageTreeWidget.cpp:223
Isis::ImageList::supportedActions
QList< QAction * > supportedActions(Project *project=NULL)
Gets a list of pre-connected actions that have to do with display.
Definition: ImageList.cpp:565
Isis::ImageTreeWidget::refit
void refit()
Definition: ImageTreeWidget.cpp:183
Isis::ImageTreeWidget::ImagePosition::group
int group() const
Definition: ImageTreeWidget.cpp:374
Isis::ImageTreeWidgetItem::TreeColumn
TreeColumn
Definition: ImageTreeWidgetItem.h:35
Isis::ImageTreeWidget::ImagePosition::swap
void swap(ImagePosition &other)
Definition: ImageTreeWidget.cpp:389
ImageTreeWidget.h
Isis::toInt
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:93
Isis::ImageTreeWidget::mousePressEvent
void mousePressEvent(QMouseEvent *event)
This is why we needed to subclass the QTreeWidget class.
Definition: ImageTreeWidget.cpp:597
Isis::ImageTreeWidget::groupInList
bool groupInList(QList< QTreeWidgetItem * >)
Definition: ImageTreeWidget.cpp:870
Isis::ImageTreeWidget::createGroup
QTreeWidgetItem * createGroup(QTreeWidgetItem *imageListItem, QString groupName="", int index=-1)
Definition: ImageTreeWidget.cpp:141
Isis::ImageTreeWidget::TreeItemContainerType
TreeItemContainerType
Definition: ImageTreeWidget.h:47
Isis::ImageTreeWidget::imagesInView
ImageList imagesInView()
Definition: ImageTreeWidget.cpp:321
Isis::ImageTreeWidget::ImagePosition::setPosition
void setPosition(int outerIndex, int innerIndex)
Definition: ImageTreeWidget.cpp:363
Isis::ImageTreeWidget::ImageTreeWidget
ImageTreeWidget(Directory *directory=0, QWidget *parent=0)
ImageTreeWidget constructor.
Definition: ImageTreeWidget.cpp:32
ImageList.h
Isis::Image
This represents a cube in a project-based GUI interface.
Definition: Image.h:107
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::ImageTreeWidgetItem::NorthAzimuthColumn
@ NorthAzimuthColumn
Definition: ImageTreeWidgetItem.h:49
Isis::ImageTreeWidget::disableSort
void disableSort()
Definition: ImageTreeWidget.cpp:209
Isis::ImageTreeWidgetItem::image
Image * image()
Definition: ImageTreeWidgetItem.cpp:59
Isis::ImageTreeWidget::actions
QList< QAction * > actions()
Definition: ImageTreeWidget.cpp:113
Isis::Image::displayProperties
ImageDisplayProperties * displayProperties()
Get the display (GUI) properties (information) associated with this image.
Definition: Image.cpp:320
ProgressBar.h
IException.h
Isis::ImageTreeWidget::ImagePosition::isValid
bool isValid() const
Definition: ImageTreeWidget.cpp:384
Isis::toBool
bool toBool(const QString &string)
Global function to convert from a string to a boolean.
Definition: IString.cpp:38
QMap
This is free and unencumbered software released into the public domain.
Definition: CubeIoHandler.h:22
Isis::ImageTreeWidget
Definition: ImageTreeWidget.h:42
QObject
Isis::ImageTreeWidgetItem::NameColumn
@ NameColumn
Definition: ImageTreeWidgetItem.h:36
Isis::ImageTreeWidget::dropEvent
void dropEvent(QDropEvent *event)
Definition: ImageTreeWidget.cpp:422
Isis::ImageTreeWidgetItem::SampleResolutionColumn
@ SampleResolutionColumn
Definition: ImageTreeWidgetItem.h:47
QAction
Isis::ImageTreeWidget::prepCube
ImageTreeWidgetItem * prepCube(ImageList *imageList, Image *image)
Definition: ImageTreeWidget.cpp:300
Isis::ImageTreeWidgetItem::FootprintColumn
@ FootprintColumn
Definition: ImageTreeWidgetItem.h:37
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ImageTreeWidgetItem::ResolutionColumn
@ ResolutionColumn
Definition: ImageTreeWidgetItem.h:42
Isis::ImageTreeWidget::addGroup
QTreeWidgetItem * addGroup(QString imageListName, QString groupName="", int index=-1)
Definition: ImageTreeWidget.cpp:129