UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
seismic_area_widget.hpp
1 /* seismic_area_widget.hpp */
2 /* $Id$ */
3 #ifndef __seismic_area_widget_hpp
4 #define __seismic_area_widget_hpp
5 //------------------------------------------------------------------------------------------
6 
7 #include <QWidget>
8 #include <QGridLayout>
9 
10 #include <zq4/qzq_area.hpp>
11 #include <zq4/zq_layout.hpp>
12 #include <zq4/zq_custom_scale.hpp>
13 #include <zq4/zq_scrollbar.hpp>
14 #include <zq4/zq_zoom.hpp>
15 #include <zq4/zq_grid.hpp>
16 #include <zq4/zq_title.hpp>
17 #include <zq4/zq_seismic_view.hpp>
18 #include <zq4/zd_seismic_set.hpp>
19 #include <hds_widgets/seismic_area.hpp>
20 
22 namespace hds
23 {
44  class SeismicAreaWidget : public QWidget, public hds::SeismicArea
45  {
46  Q_OBJECT
47 
48  public:
49 
51  SeismicAreaWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
52 
54  SeismicAreaWidget(QPaintDevice *pdev, QWidget *parent = 0, Qt::WindowFlags f = 0);
55 
57  virtual ~SeismicAreaWidget();
58 
59 
61  virtual void attachData(ZdSeismicSet &seis_set);
62 
64  virtual void detachData();
65 
67  virtual ZdSeismicSet* data();
68 
69 
71  void setInteractiveMode(int imode);
72 
73 
75  virtual void addCoordAxis(const CoordAxisVisMode &axis_vis_mode);
76 
78  virtual void removeCoordAxes();
79 
81  virtual size_t coordAxesNum() const;
82 
85  virtual bool getCoordAxisVisMode(size_t id, CoordAxisVisMode &axis_vis_mode) const;
86 
89  virtual bool setCoordAxisVisMode(size_t id, const CoordAxisVisMode &axis_vis_mode);
90 
91 
92 
96  virtual void redraw(bool repaint_flag = true);
97 
98 
99 
100  // ---- Zooming ---------------------------------------------------------------------------
104  void zoomAll(bool repaint_flag = true);
105 
109  void zoomIn(bool repaint_flag = true);
110 
114  void zoomOut(bool repaint_flag = true);
115 
116 
120  void setClosable(const bool closable = true)
121  {m_closable = closable;}
122 
123 
126 
127 signals:
128 
131  void toolTipDelivered(const QString& tip_str, const QString& info_str);
132 
133 protected:
134 
136  struct CoordAxis
137  {
139  CoordAxis() : scale(NULL), title(NULL) {/* Nothing to do. */}
140 
143  };
144 
146  std::vector<CoordAxis> m_coord_axes;
147 
150 
153 
155  QGridLayout *mp_grid_layout;
156 
159 
161  ZqSeismicView *mp_seis_view;
162 
165 
168 
170  ZqScrollBar *mp_bottom_scrbar, *mp_right_scrbar;
171 
174 
177 
180 
182  QPaintDevice *m_pdev;
183 
185  virtual void init(QWidget *parent, Qt::WindowFlags f);
186 
187  void closeEvent(QCloseEvent *ev);
188 
189  virtual void showEvent(QShowEvent *ev);
190 
191  virtual void paintEvent(QPaintEvent *pev);
192 
193  private:
194 
196  double m_current_coord_ranges[2];
197 
199  void setup_axes();
200 
202  void setup_titles();
203 
205  void setup_grid();
206 
208  void setup_zoom();
209 
211  void setup_groups_order();
212 
213  QString coord_scale_id2name(size_t id) {return QString("coord_scale_%1").arg(id);}
214  QString coord_title_id2name(size_t id) {return QString("coord_title_%1").arg(id);}
215  void coord_axis_vis2axis(size_t id, ZqbTraceView view_mode,
216  const CoordAxisVisMode &axis_vis_mode,
217  CoordAxis &axis);
218  void coord_axis2axis_vis(const CoordAxis &axis, CoordAxisVisMode &axis_vis_mode) const;
219 
220  void adjust_coord_ranges();
221  };
222 };
223 
224 #endif /* seismic_area_widget.hpp */
ZqTitle * title
Definition: seismic_area_widget.hpp:142
ZqGrid * mp_time_grid
Definition: seismic_area_widget.hpp:176
void zoomIn(bool repaint_flag=true)
QGridLayout * mp_grid_layout
Definition: seismic_area_widget.hpp:155
virtual void init(QWidget *parent, Qt::WindowFlags f)
QzqArea * getZqArea()
Definition: seismic_area_widget.hpp:125
virtual ~SeismicAreaWidget()
virtual bool setCoordAxisVisMode(size_t id, const CoordAxisVisMode &axis_vis_mode)
SeismicAreaWidget(QWidget *parent=0, Qt::WindowFlags f=0)
Definition: zq_layout.hpp:22
QzqArea * mp_zqarea
Definition: seismic_area_widget.hpp:152
virtual size_t coordAxesNum() const
virtual ZdSeismicSet * data()
virtual void redraw(bool repaint_flag=true)
virtual void detachData()
void setClosable(const bool closable=true)
Definition: seismic_area_widget.hpp:120
Definition: zq_seismic_view.hpp:36
Definition: zq_custom_scale.hpp:22
ZqLayout * mp_zqlayout
Definition: seismic_area_widget.hpp:158
std::vector< CoordAxis > m_coord_axes
Definition: seismic_area_widget.hpp:146
Definition: zq_title.hpp:20
ZdSeismicSet * mp_seis_doc
Definition: seismic_area_widget.hpp:149
virtual void attachData(ZdSeismicSet &seis_set)
ZqZoom * mp_seis_zoom
Definition: seismic_area_widget.hpp:173
Definition: zq_zoom.hpp:17
CoordAxis()
Definition: seismic_area_widget.hpp:139
virtual void addCoordAxis(const CoordAxisVisMode &axis_vis_mode)
Definition: zq_scrollbar.hpp:24
Definition: seismic_area_widget.hpp:136
ZqCustomScale * scale
Definition: seismic_area_widget.hpp:141
ZqTitle * mp_time_title
Definition: seismic_area_widget.hpp:167
Definition: seismic_area_widget.hpp:44
Definition: qzq_area.hpp:39
Definition: seismic_area.hpp:20
Definition: seismic_area.hpp:25
virtual bool getCoordAxisVisMode(size_t id, CoordAxisVisMode &axis_vis_mode) const
Definition: zq_grid.hpp:21
void zoomOut(bool repaint_flag=true)
virtual void removeCoordAxes()
Definition: zd_seismic_set.hpp:17
void zoomAll(bool repaint_flag=true)
bool m_closable
Definition: seismic_area_widget.hpp:179
void setInteractiveMode(int imode)
Definition: zq_scale.hpp:22
ZqScale * mp_time_scale
Definition: seismic_area_widget.hpp:164
void toolTipDelivered(const QString &tip_str, const QString &info_str)
ZqScrollBar * mp_right_scrbar
Definition: seismic_area_widget.hpp:170