USGS

Isis 3.0 Developer's Reference (API)

Home

MosaicSceneWidget.h

Go to the documentation of this file.
00001 #ifndef MosaicSceneWidget_H
00002 #define MosaicSceneWidget_H
00003 
00004 #include <QWidget>
00005 
00006 template <typename A> class QList;
00007 class QGraphicsPolygonItem;
00008 class QGraphicsRectItem;
00009 class QGraphicsScene;
00010 class QMenu;
00011 class QProgressBar;
00012 class QRubberBand;
00013 class QStatusBar;
00014 class QToolBar;
00015 class QToolButton;
00016 
00017 namespace Isis {
00018   class CubeDisplayProperties;
00019   class MosaicGraphicsView;
00020   class MosaicSceneItem;
00021   class MosaicTool;
00022   class ProgressBar;
00023   class Projection;
00024   class PvlGroup;
00025   class PvlObject;
00026   class ToolPad;
00027 
00083   class MosaicSceneWidget : public QWidget {
00084       Q_OBJECT
00085 
00086     public:
00087       MosaicSceneWidget(QStatusBar *status, QWidget *parent = 0);
00088       virtual ~MosaicSceneWidget();
00089 
00090       MosaicGraphicsView *getView() const {
00091         return m_graphicsView;
00092       }
00093 
00094       QGraphicsScene *getScene() const {
00095         return m_graphicsScene;
00096       }
00097 
00098       Projection *getProjection() const {
00099         return m_projection;
00100       }
00101 
00102       QList<MosaicSceneItem *> allMosaicSceneItems() {
00103         return *m_mosaicSceneItems;
00104       }
00105 
00106       void addTo(QMenu *menu);
00107       void addTo(ToolPad *toolPad);
00108       void addToPermanent(QToolBar *toolBar);
00109       void addTo(QToolBar *toolBar);
00110 
00111       bool cubesSelectable() const {
00112         return m_cubesSelectable;
00113       }
00114 
00115       void enableRubberBand(bool);
00116       void blockSelectionChange(bool);
00117 
00118       bool userHasTools() const {
00119         return m_userToolControl;
00120       }
00121 
00122       QProgressBar *getProgress();
00123       PvlObject toPvl() const;
00124       void fromPvl(const PvlObject &);
00125       void preloadFromPvl(const PvlObject &);
00126 
00127       QRectF cubesBoundingRect() const;
00128       QStringList cubeFileNames();
00129       QList<CubeDisplayProperties *> cubeDisplays();
00130 
00131       QList<QAction *> getExportActions();
00132       QList<QAction *> getViewActions();
00133 
00134       static QWidget *getControlNetHelp(QWidget *cnetToolContainer = NULL);
00135       static QWidget *getGridHelp(QWidget *gridToolContainer = NULL);
00136       static QWidget *getLongHelp(QWidget *mosaicSceneContainer = NULL);
00137       static QWidget *getMapHelp(QWidget *mapContainer = NULL);
00138       static QWidget *getPreviewHelp(QWidget *worldViewContainer = NULL);
00139 
00140     signals:
00141       void mouseEnter();
00142       void mouseMove(QPointF);
00143       void mouseLeave();
00144       void mouseDoubleClick(QPointF);
00145       void mouseButtonPress(QPointF, Qt::MouseButton s);
00146       void mouseButtonRelease(QPointF, Qt::MouseButton s);
00147       void mouseWheel(QPointF, int delta);
00148       void projectionChanged(Projection *);
00149       void rubberBandComplete(QRectF r, Qt::MouseButton s);
00150       void visibleRectChanged(QRectF);
00151 
00152       void cubesChanged();
00153 
00154     public slots:
00155       void addCubes(QList<CubeDisplayProperties *>);
00156       void refit();
00157       void setCubesSelectable(bool);
00158       void setProjection(Projection *);
00159       void setOutlineRect(QRectF);
00160 
00161     private slots:
00162       void exportView();
00163       void saveList();
00164 
00165       void removeMosItem(QObject *);
00166 
00167       void moveDownOne();
00168       void moveToBottom();
00169       void moveUpOne();
00170       void moveToTop();
00171       void fitInView();
00172 
00173       void onSelectionChanged();
00174 
00175       void configProjectionParameters();
00176       void quickConfigProjectionParameters();
00177       void sendVisibleRectChanged();
00178 
00179     protected:
00180       virtual bool eventFilter(QObject *obj, QEvent *ev);
00181 
00182     private:
00183       void setProjection(const PvlGroup &);
00184       MosaicSceneItem *addCube(CubeDisplayProperties *);
00185       void createReferenceFootprint();
00186       void reprojectItems();
00187       qreal maximumZ();
00188       qreal minimumZ();
00189       void recalcSceneRect();
00190 
00191       MosaicSceneItem *getNextItem(MosaicSceneItem *item, bool up);
00192 
00193       PvlGroup createInitialProjection(CubeDisplayProperties *cube);
00194 
00195       MosaicSceneItem *cubeToMosaic(CubeDisplayProperties *);
00196 
00197       QList<CubeDisplayProperties *> getSelectedCubes() const;
00198 
00199       static bool zOrderGreaterThan(MosaicSceneItem *first,
00200                                     MosaicSceneItem *second);
00201 
00202       bool m_cubesSelectable;
00203       bool m_customRubberBandEnabled;
00204       QRubberBand *m_customRubberBand;
00205       QPoint *m_rubberBandOrigin;
00206       QGraphicsScene *m_graphicsScene; 
00207       MosaicGraphicsView *m_graphicsView; 
00208       Projection *m_projection; 
00209       QGraphicsPolygonItem *m_projectionFootprint;
00210       QList<MosaicSceneItem *> *m_mosaicSceneItems;
00211       QGraphicsRectItem *m_outlineRect;
00212 
00213       QToolButton *m_mapButton;
00214       QAction *m_quickMapAction;
00215 
00216       QList<MosaicTool *> *m_tools;
00217       ProgressBar *m_progress;
00218 
00219       bool m_userToolControl;
00220       bool m_ownProjection;
00221   };
00222 }
00223 
00224 #endif
00225