Isis 3 Programmer Reference
MosaicSceneWidget.h
1#ifndef MosaicSceneWidget_H
2#define MosaicSceneWidget_H
3
4#include <QWidget>
5
6#include "ImageList.h"
7#include "Pvl.h"
8
9template <typename A> class QList;
10
11class QGraphicsPolygonItem;
13class QGraphicsScene;
14class QGraphicsSceneContextMenuEvent;
15class QMenu;
16class QProgressBar;
17class QRubberBand;
18class QStatusBar;
19class QToolBar;
20class QToolButton;
21
22namespace Isis {
23 class ControlPoint;
24 class Directory;
25 class Image;
26 class MosaicGraphicsView;
27 class MosaicSceneItem;
28 class MosaicTool;
29 class ProgressBar;
30 class Projection;
31 class PvlGroup;
32 class PvlObject;
33 class ToolPad;
34
153 class MosaicSceneWidget : public QWidget {
154 Q_OBJECT
155
156 public:
157 MosaicSceneWidget(QStatusBar *status,
158 bool showTools, bool internalizeToolBarsAndProgress,
159 Directory *directory, QWidget *parent = 0);
160 virtual ~MosaicSceneWidget();
161
162 MosaicGraphicsView *getView() const {
163 return m_graphicsView;
164 }
165
166 QGraphicsScene *getScene() const {
167 return m_graphicsScene;
168 }
169
170 Projection *getProjection() const {
171 return m_projection;
172 }
173
174 QList<MosaicSceneItem *> allMosaicSceneItems() {
175 return *m_mosaicSceneItems;
176 }
177
178 void addTo(QMenu *menu);
179 void addTo(ToolPad *toolPad);
180 void addToPermanent(QToolBar *toolBar);
181 void addTo(QToolBar *toolBar);
182
183 using QWidget::contextMenuEvent;
184 bool contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
185
186 MosaicSceneItem *cubeToMosaic(Image *);
187
188 bool cubesSelectable() const {
189 return m_cubesSelectable;
190 }
191
192 void enableRubberBand(bool);
193 bool blockSelectionChange(bool);
194
195 bool userHasTools() const {
196 return m_userToolControl;
197 }
198
199 QProgressBar *getProgress();
200 PvlObject toPvl() const;
201 void fromPvl(const PvlObject &);
202 void save(QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const;
203
204// QPointF currentLatLonPosition();
205 QRectF cubesBoundingRect() const;
206 QStringList cubeFileNames();
207 Directory *directory() const;
208
209 ImageList images();
211
212 QList<QAction *> getExportActions();
213 QList<QAction *> getViewActions();
214 QList<QAction *> supportedActions(ImageList *);
215
216 double moveDownOne(MosaicSceneItem *);
217 double moveDownOne(Image *);
218 QList<double> moveDownOne(ImageList *);
219
221 double moveToBottom(Image *);
222 QList<double> moveToBottom(ImageList *);
223
224 double moveUpOne(MosaicSceneItem *);
225 double moveUpOne(Image *);
226 QList<double> moveUpOne(ImageList *);
227
228 double moveToTop(MosaicSceneItem *);
229 double moveToTop(Image *);
230 QList<double> moveToTop(ImageList *);
231
232 double moveZ(MosaicSceneItem *sceneItem, double newZ, bool newZValueMightExist = true);
233 double moveZ(Image *image, double newZ, bool newZValueMightExist = true);
234
238 template <typename DataType>
239 QList<QAction *> supportedActions(DataType) {
240 return QList<QAction *>();
241 }
242
243 bool isControlNetToolActive();
244
245 static QWidget *getControlNetHelp(QWidget *cnetToolContainer = NULL);
246 static QWidget *getGridHelp(QWidget *gridToolContainer = NULL);
247 static QWidget *getLongHelp(QWidget *mosaicSceneContainer = NULL);
248 static QWidget *getMapHelp(QWidget *mapContainer = NULL);
249 static QWidget *getPreviewHelp(QWidget *worldViewContainer = NULL);
250
251 signals:
252 void mouseEnter();
253 void mouseMove(QPointF);
254 void mouseLeave();
255 void mouseDoubleClick(QPointF);
256 void mouseButtonPress(QPointF, Qt::MouseButton s);
257 void mouseButtonRelease(QPointF, Qt::MouseButton s);
258 void mouseWheel(QPointF, int delta);
259 void projectionChanged(Projection *);
260 void rubberBandComplete(QRectF r, Qt::MouseButton s);
261 void visibleRectChanged(QRectF);
262
263 void cubesChanged();
264
265 void queueSelectionChanged();
266
267 void modifyControlPoint(ControlPoint *controlPoint);
268 void deleteControlPoint(ControlPoint *controlPoint);
269 void createControlPoint(double latitude, double longitude);
270
271 void controlPointSelected(ControlPoint *);
272
273 void cnetModified();
274 void controlPointChanged(QString pointId);
275 void controlPointDeleted();
276
277 void mosCubeClosed(Image *);
278
279 public slots:
280 void addImages(ImageList);
281 void removeImages(ImageList);
282 void refit();
283 void setCubesSelectable(bool);
285 void setOutlineRect(QRectF);
286
287 private slots:
288 void exportView();
289 void saveList();
290
291 void removeMosItem(QObject *);
292
293 void moveDownOne();
294 void moveToBottom();
295 void moveUpOne();
296 void moveToTop();
297 void fitInView();
298
299 void onSelectionChanged();
300 void onQueuedSelectionChanged();
301
303 void quickConfigProjectionParameters();
304 void sendVisibleRectChanged();
305
306 protected:
307 virtual bool eventFilter(QObject *obj, QEvent *ev);
308
309 private:
310 void setProjection(const PvlGroup &mappingGroup, Pvl label=Pvl());
311 MosaicSceneItem *addImage(Image *image);
312 void reprojectItems();
313 double maximumZ();
314 double minimumZ();
315 void recalcSceneRect();
316
318
319 PvlGroup createInitialProjection(Image *cube);
320
321 MosaicSceneItem *cubeToMosaic(DisplayProperties *props);
322
323 static bool zOrderGreaterThan(MosaicSceneItem *first,
324 MosaicSceneItem *second);
325
326 private:
327 Directory *m_directory;
328
329 bool m_cubesSelectable;
330 bool m_customRubberBandEnabled;
331 QRubberBand *m_customRubberBand;
332 QPoint *m_rubberBandOrigin;
336 QList<MosaicSceneItem *> *m_mosaicSceneItems;
337 QMap<DisplayProperties *, MosaicSceneItem *> m_displayPropsToMosaicSceneItemMap;
338 QGraphicsRectItem *m_outlineRect;
339
340 QToolButton *m_mapButton;
341 QAction *m_quickMapAction;
342
343 QList<MosaicTool *> *m_tools;
344
345 ToolPad *m_toolpad;
346
347 QToolBar *m_permToolbar;
348 QToolBar *m_activeToolbar;
349
350 ProgressBar *m_progress;
351
352 QHash<QString, double> *m_projectImageZOrders;
353
354 bool m_blockingSelectionChanged;
355 bool m_userToolControl;
356 bool m_ownProjection;
357 bool m_queuedSelectionChanged;
358 bool m_shouldRequeueSelectionChanged;
359
360 double m_currentMinimumFootprintZ;
361 double m_currentMaximumFootprintZ;
362
363 PvlObject *m_projectViewTransform;
364 };
365}
366
367#endif
368
A single control point.
File name manipulation and expansion.
Definition FileName.h:100
This represents a cube in a project-based GUI interface.
Definition Image.h:105
Internalizes a list of images and allows for operations on the entire list.
Definition ImageList.h:53
A graphics view that resizes in a more friendly way.
A single cube in the mosaic scene.
This widget encompasses the entire mosaic scene.
void configProjectionParameters()
This happens when the user clicks on the map action (the button that is named after the current proje...
QList< QAction * > supportedActions(ImageList *)
Get a list of actions this scene can perform given "images".
bool contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
This is called by MosaicGraphicsScene::contextMenuEvent.
MosaicGraphicsView * m_graphicsView
The graphics view.
QList< QAction * > supportedActions(DataType)
Return an empty list of actions for unknown data types.
double moveToBottom(MosaicSceneItem *)
This doesn't compress the Z values - the original Z values of this scene item is guaranteed to be emp...
QGraphicsScene * m_graphicsScene
The graphics scene that makes up this widget.
MosaicSceneItem * getNextItem(MosaicSceneItem *item, bool up)
Implemented because we want invisible items too.
void refit()
This method refits t:he items in the graphics view.
MosaicSceneWidget(QStatusBar *status, bool showTools, bool internalizeToolBarsAndProgress, Directory *directory, QWidget *parent=0)
Create a scene widget.
ImageList selectedImages()
Returns a list of all the cubes selected in the scene.
void fromPvl(const PvlObject &)
Call this method after loading any cubes when loading a project.
Projection * m_projection
The current projection type.
double moveToTop(MosaicSceneItem *)
This doesn't compress the Z values - the original Z values of this scene item is guaranteed to be emp...
double moveZ(MosaicSceneItem *sceneItem, double newZ, bool newZValueMightExist=true)
This method moves the given scene item to the given Z value.
void setProjection(Projection *)
This method takes ownership of proj.
void reprojectItems()
Reprojects all the items in the view.
void exportView()
Saves the scene as a png, jpg, or tif file.
The main project for ipce.
Definition Project.h:287
Base class for Map Projections.
Definition Projection.h:155
Contains multiple PvlContainers.
Definition PvlGroup.h:41
Container for cube-like labels.
Definition Pvl.h:119
Contains Pvl Groups and Pvl Objects.
Definition PvlObject.h:61
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16