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 
QWidget
Isis::UniversalGroundMap
Universal Ground Map.
Definition: UniversalGroundMap.h:69
Isis::MosaicSceneItem::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Re-paints the item.
Definition: MosaicSceneItem.cpp:140
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
Isis::Stretch
Pixel value mapper.
Definition: Stretch.h:58
Isis::MosaicSceneItem::cubeDisplayChanged
void cubeDisplayChanged()
Someone changed something in the cube display properties, re-read the whole thing.
Definition: MosaicSceneItem.cpp:423
Isis::MosaicSceneWidget
This widget encompasses the entire mosaic scene.
Definition: MosaicSceneWidget.h:153
Isis::MosaicSceneItem::MosaicSceneItem
MosaicSceneItem(const MosaicSceneItem &)
cannot copy
Isis::MosaicSceneItem::contextMenuEvent
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
The user right clicked on us (or otherwise requested a context menu).
Definition: MosaicSceneItem.cpp:556
Isis::MosaicSceneItem::contains
bool contains(const QPointF &) const
Test if we contain the point.
Definition: MosaicSceneItem.cpp:494
Isis::MosaicSceneItem::reproject
void reproject()
Called anytime the user reprojects the cube.
Definition: MosaicSceneItem.cpp:189
QGraphicsObject
Isis::MosaicSceneItem::operator=
MosaicSceneItem & operator=(const MosaicSceneItem &)
cannot assign
Isis::MosaicSceneItem::MosaicSceneItem
MosaicSceneItem(Image *image, MosaicSceneWidget *parent)
MosaicSceneItem constructor.
Definition: MosaicSceneItem.cpp:47
Isis::MosaicSceneItem::updateSelection
void updateSelection(bool)
Update the selected state.
Definition: MosaicSceneItem.cpp:516
Isis::MosaicSceneItem::m_mp
geos::geom::MultiPolygon * m_mp
This item's multipolygon in the 0/360 longitude domain.
Definition: MosaicSceneItem.h:97
Isis::MosaicSceneItem::drawImage
void drawImage(QPainter *painter, const QStyleOptionGraphicsItem *option)
This method reads in and draws the image associated with this item.
Definition: MosaicSceneItem.cpp:323
Isis::MosaicSceneItem::updateChildren
void updateChildren()
This applies the displayProperties and selectability.
Definition: MosaicSceneItem.cpp:624
Isis::MosaicSceneItem::m_180mp
geos::geom::MultiPolygon * m_180mp
This item's multipolygon in the -180/180 longitude domain.
Definition: MosaicSceneItem.h:98
Isis::Image
This represents a cube in a project-based GUI interface.
Definition: Image.h:107
Isis::MosaicSceneItem::getStretch
Stretch * getStretch()
This gets a Stretch object that will work for the cubeDisplay converting from DN to screen pixel.
Definition: MosaicSceneItem.cpp:691
Isis::MosaicSceneItem::getPixelValue
double getPixelValue(int sample, int line)
Returns the pixel value at the given sample/line.
Definition: MosaicSceneItem.cpp:298
Isis::MosaicSceneItem
A single cube in the mosaic scene.
Definition: MosaicSceneItem.h:47
Isis::MosaicSceneItem::sceneEvent
virtual bool sceneEvent(QEvent *event)
This filters out events that happen within our polygons.
Definition: MosaicSceneItem.cpp:451
Isis::MosaicSceneItem::onCloseCube
void onCloseCube()
Emits a signal when Close Cube is selected from the context menu.
Definition: MosaicSceneItem.cpp:614
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::MosaicSceneItem::~MosaicSceneItem
~MosaicSceneItem()
Mosaic Item destructor.
Definition: MosaicSceneItem.cpp:103