Isis 3 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:
110  void queueSelectionChanged();
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 
QTreeWidgetItem * createImageListNameItem(QString name)
Definition: ImageTreeWidget.cpp:173
void dropEvent(QDropEvent *event)
Definition: ImageTreeWidget.cpp:422
bool groupInList(QList< QTreeWidgetItem *>)
Definition: ImageTreeWidget.cpp:870
Internalizes a list of images and allows for operations on the entire list.
Definition: ImageList.h:55
virtual ~ImagePosition()
Definition: ImageTreeWidget.cpp:358
void contextMenuEvent(QContextMenuEvent *event)
Definition: ImageTreeWidget.cpp:615
virtual ~ImageTreeWidget()
Definition: ImageTreeWidget.cpp:105
Definition: ImageTreeWidgetItem.h:20
void swap(ImagePosition &other)
Definition: ImageTreeWidget.cpp:389
QList< QAction * > actions()
Definition: ImageTreeWidget.cpp:113
ImageTreeWidget(Directory *directory=0, QWidget *parent=0)
ImageTreeWidget constructor.
Definition: ImageTreeWidget.cpp:32
bool isValid() const
Definition: ImageTreeWidget.cpp:384
bool operator<(const ImagePosition &rhs)
Definition: ImageTreeWidget.cpp:395
void disableSort()
Definition: ImageTreeWidget.cpp:209
Definition: DisplayProperties.h:26
void queueReadDisplayProperties()
This represents a cube in a project-based GUI interface.
Definition: Image.h:107
Definition: ImageTreeWidget.h:48
QList< QAction * > getViewActions()
Definition: ImageTreeWidget.cpp:223
QTreeWidgetItem * createGroup(QTreeWidgetItem *imageListItem, QString groupName="", int index=-1)
Definition: ImageTreeWidget.cpp:141
ImageList imagesInView()
Definition: ImageTreeWidget.cpp:321
Definition: ImageTreeWidget.h:42
ImageTreeWidgetItem * prepCube(ImageList *imageList, Image *image)
Definition: ImageTreeWidget.cpp:300
QTreeWidgetItem * addGroup(QString imageListName, QString groupName="", int index=-1)
Definition: ImageTreeWidget.cpp:129
void refit()
Definition: ImageTreeWidget.cpp:183
ImagePosition & operator=(const ImagePosition &rhs)
Definition: ImageTreeWidget.cpp:408
void mousePressEvent(QMouseEvent *event)
This is why we needed to subclass the QTreeWidget class.
Definition: ImageTreeWidget.cpp:597
Definition: BoxcarCachingAlgorithm.h:29
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
int index() const
Definition: ImageTreeWidget.cpp:379
void updateViewActs()
Definition: ImageTreeWidget.cpp:247
int group() const
Definition: ImageTreeWidget.cpp:374
Definition: ImageTreeWidget.h:49
Definition: ImageTreeWidget.h:82
void enqueueReadDisplayProperties(ImageTreeWidgetItem *)
Definition: ImageTreeWidget.cpp:214
Definition: Directory.h:285
ImagePosition()
Definition: ImageTreeWidget.cpp:341
Definition: CubeIoHandler.h:38
void setPosition(int outerIndex, int innerIndex)
Definition: ImageTreeWidget.cpp:363
TreeItemContainerType
Definition: ImageTreeWidget.h:47