Isis 3 Programmer Reference
MosaicSceneItem.h
1 #ifndef MosaicItem_H
2 #define MosaicItem_H
3 
4 #include <QAbstractGraphicsShapeItem>
5 
6 class QGraphicsPolygonItem;
7 
8 namespace geos {
9  namespace geom {
10  class MultiPolygon;
11  }
12 }
13 
14 namespace Isis {
15  class Camera;
16  class Image;
17  class MosaicSceneWidget;
18  class Projection;
19  class PvlGroup;
20  class Stretch;
21  class UniversalGroundMap;
22 
48  Q_OBJECT
49  public:
50  MosaicSceneItem(Image *image, MosaicSceneWidget *parent);
52 
53  virtual QRectF boundingRect() const;
54  virtual void paint(QPainter *painter,
55  const QStyleOptionGraphicsItem *option,
56  QWidget *widget = 0);
57 
58  QColor color() const;
59  Image *image() { return m_image; }
60  QGraphicsSimpleTextItem *getLabel() const { return m_label; }
61 
62  void reproject();
63  bool contains(const QPointF &) const;
64  void updateSelection(bool);
65 
66  void scenePropertiesChanged() {
68  }
69 
70  signals:
71  void colorChanged();
72  void changed(const QList<QRectF> &);
73  void mosaicCubeClosed(Image *);
74 
75  public slots:
76  void cubeDisplayChanged();
77 
78  protected:
79  virtual bool sceneEvent(QEvent *event);
80 
81  protected:
82  virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
83 
84  private slots:
85  void lostCubeDisplay();
86  void onCloseCube();
87 
88  private:
91 
92  void updateChildren();
94 
95  MosaicSceneWidget *m_scene;
96 
97  geos::geom::MultiPolygon *m_mp;
98  geos::geom::MultiPolygon *m_180mp;
100  UniversalGroundMap *groundMap;
101 
102  void setupFootprint();
103  void drawImage(QPainter *painter, const QStyleOptionGraphicsItem *option);
104 
105  double getPixelValue(int sample, int line);
106  void setupStretch();
107 
108  Image *m_image;
109  Stretch *m_cubeDnStretch;
110 
111  bool m_showingLabel;
112  bool m_ignoreCubeDisplayChanged;
113 
114  QGraphicsSimpleTextItem *m_label;
115  };
116 };
117 
118 #endif
119 
MosaicSceneItem(Image *image, MosaicSceneWidget *parent)
MosaicSceneItem constructor.
void updateSelection(bool)
Update the selected state.
void reproject()
Called anytime the user reprojects the cube.
geos::geom::MultiPolygon * m_180mp
This item&#39;s multipolygon in the -180/180 longitude domain.
Universal Ground Map.
geos::geom::MultiPolygon * m_mp
This item&#39;s multipolygon in the 0/360 longitude domain.
This widget encompasses the entire mosaic scene.
void drawImage(QPainter *painter, const QStyleOptionGraphicsItem *option)
This method reads in and draws the image associated with this item.
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
The user right clicked on us (or otherwise requested a context menu).
Pixel value mapper.
Definition: Stretch.h:72
This represents a cube in a project-based GUI interface.
Definition: Image.h:107
Definition: Image.h:43
void onCloseCube()
Emits a signal when Close Cube is selected from the context menu.
bool contains(const QPointF &) const
Test if we contain the point.
MosaicSceneItem & operator=(const MosaicSceneItem &)
cannot assign
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
virtual bool sceneEvent(QEvent *event)
This filters out events that happen within our polygons.
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Re-paints the item.
Stretch * getStretch()
This gets a Stretch object that will work for the cubeDisplay converting from DN to screen pixel...
~MosaicSceneItem()
Mosaic Item destructor.
double getPixelValue(int sample, int line)
Returns the pixel value at the given sample/line.
void updateChildren()
This applies the displayProperties and selectability.
void cubeDisplayChanged()
Someone changed something in the cube display properties, re-read the whole thing.
A single cube in the mosaic scene.