OpendTect-6_4  6.4
uistratdisplay.h
Go to the documentation of this file.
1 #ifndef uistratdisplay_h
2 #define uistratdisplay_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bruno
9  Date: Mar 2010
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uistratmod.h"
16 #include "uidialog.h"
17 #include "uigraphicsview.h"
18 
19 #include "uigraphicsitem.h"
20 #include "geometry.h"
21 #include "uistratdispdata.h"
22 #include "uistring.h"
23 
24 class uiAxisHandler;
25 class uiGenInput;
26 class uiGraphicsScene;
27 class uiLabeledSpinBox;
28 class uiParent;
29 class uiPolygonItem;
30 class uiPolyLineItem;
31 class uiPushButton;
32 class uiStratViewControl;
33 class uiTextItem;
34 class uiToolButton;
35 class MouseEvent;
36 
37 
38 
40 { mODTextTranslationClass(uiStratDrawer)
41 public:
42  uiStratDrawer(uiGraphicsScene&,
43  const StratDispData&);
44  ~uiStratDrawer();
45 
46  void setZRange(const StepInterval<float>&);
47 
48  void draw();
49  void drawColumns();
50  void setNewAxis(uiAxisHandler*,bool isx);
51 
52  uiAxisHandler* xAxis() { return xax_; }
53  uiAxisHandler* yAxis() { return yax_; }
54  const uiAxisHandler* xAxis() const { return xax_; }
55  const uiAxisHandler* yAxis() const { return yax_; }
56 
57  mStruct(uiStrat) ColumnItem
58  {
59  ColumnItem(const char* nm)
60  : name_(nm)
61  , borderitm_(0)
62  , bordertxtitm_(0) {}
63 
64  BufferString name_;
65  int size_;
66  int pos_;
67 
68  uiPolyLineItem* borderitm_;
69  uiTextItem* bordertxtitm_;
70  uiGraphicsItemSet txtitms_;
71  uiGraphicsItemSet unititms_;
72  uiGraphicsItemSet lvlitms_;
73  };
74 
75  const ColumnItem& colItem( int idx ) const
76  { return *colitms_[idx]; }
77 
78 protected:
79 
82 
86 
87  //data
89 
90  //graphics
91  void addUnit(float);
92  void drawBorders(ColumnItem&);
93  void drawLevels(ColumnItem&);
94  void drawUnits(ColumnItem&);
95  void drawEmptyText();
96  void eraseAll();
97  void initAxis();
98  void updateAxis();
99 };
100 
101 
102 
105 public:
107  ~uiStratDisplay();
108 
109  void display(bool,bool shrk=false,bool max=false);
110  void setZRange(const Interval<float>&);
111 
112  void addControl(uiToolBar*);
113  uiStratViewControl* control() { return uicontrol_; }
114 
115  void setTree();
116 
117  void setIsLocked( bool yn ) { islocked_ = yn; }
118  bool isLocked() const { return islocked_; }
119 
120 protected :
121 
124 
128 
134  bool islocked_;
135 
137 
138  void createDispParamGrp();
139  void setRange();
140 
141  bool handleUserClick(const MouseEvent&);
142 
143  int getColIdxFromPos() const;
144  StratDispData::Column* getColFromPos() const;
145  const StratDispData::Unit* getUnitFromPos() const;
146  const StratDispData::Unit* getParentUnitFromPos() const;
147  const StratDispData::Unit* getUnitFromPos(int colidx) const;
148  const StratDispData::Level* getLevelFromPos() const;
149  Geom::Point2D<float> getPos() const;
150 
151  void controlRange(CallBacker*);
152  void dispParamChgd(CallBacker*);
153  void reDraw(CallBacker*);
154  void selCols(CallBacker*);
155  void usrClickCB(CallBacker*);
156  void doubleClickCB(CallBacker*);
157  void mouseMoveCB(CallBacker*);
158 };
159 
160 
163 public:
164 
165  struct Setup
166  {
167  Setup( const Interval<float>& rg )
168  : maxrg_(rg)
169  , tb_(0) {}
170 
173  };
174 
176  ~uiStratViewControl() {detachAllNotifiers();}
177 
178  void setRange( const Interval<float>& rg )
179  { range_ = rg; }
180  const Interval<float>& range() const
181  { return range_; }
182 
183  void setSensitive(bool);
184 
186 
187 protected:
188 
195 
198 
201 
202  MouseEventHandler& mouseEventHandler();
203  void updatePosButtonStates();
204 
205  void zoomCB(CallBacker*);
206  void cancelZoomCB(CallBacker*);
207  void handDragged(CallBacker* );
208  void handDragStarted(CallBacker*);
209  void handDragging(CallBacker*);
210  void keyPressed(CallBacker*);
211  void rubBandCB(CallBacker*);
212  void dragModeCB(CallBacker*);
213  void wheelMoveCB(CallBacker*);
214 };
215 
216 #endif
Definition: uigroup.h:54
Definition: uitoolbar.h:31
#define mExpClass(module)
Definition: commondefs.h:160
uiStratDispToTree uidatawriter_
Definition: uistratdisplay.h:123
void setIsLocked(bool yn)
Definition: uistratdisplay.h:117
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
Notifier< uiStratViewControl > rangeChanged
Definition: uistratdisplay.h:185
FixedString Setup()
Definition: keystrs.h:116
const ColumnItem & colItem(int idx) const
Definition: uistratdisplay.h:75
Interval< float > range_
Definition: uistratdisplay.h:196
FixedString Level()
Definition: keystrs.h:78
is the base class for all buttons.
Definition: uibutton.h:83
const Interval< float > & range() const
Definition: uistratdisplay.h:180
uiTextItem * emptyitm_
Definition: uistratdisplay.h:81
#define mStruct(module)
Definition: commondefs.h:165
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
uiAxisHandler * yax_
Definition: uistratdisplay.h:84
uiToolButton * rubbandzoombut_
Definition: uistratdisplay.h:190
uiAxisHandler * yAxis()
Definition: uistratdisplay.h:53
const uiAxisHandler * yAxis() const
Definition: uistratdisplay.h:55
Definition: uigraphicsitemimpl.h:192
uiToolButton * vertzoominbut_
Definition: uistratdisplay.h:191
Handles an axis on a plot.
Definition: uiaxishandler.h:51
bool islocked_
Definition: uistratdisplay.h:134
used to gather all units and tied levels from a tree for display
Definition: uistratdispdata.h:153
Definition: uiparent.h:26
bool isLocked() const
Definition: uistratdisplay.h:118
uiPushButton * fillbutton_
Definition: uistratdisplay.h:132
FixedString Unit()
Definition: keystrs.h:143
uiGraphicsScene & scene_
Definition: uistratdisplay.h:83
Definition: uispinbox.h:128
uiToolButton * vertzoomoutbut_
Definition: uistratdisplay.h:192
ObjectSet< ColumnItem > colitms_
Definition: uistratdisplay.h:80
uiStratViewControl * uicontrol_
Definition: uistratdisplay.h:125
uiAxisHandler * xAxis()
Definition: uistratdisplay.h:52
General Input Element.
Definition: uigeninput.h:58
uiToolButton * cancelzoombut_
Definition: uistratdisplay.h:193
float startdragpos_
Definition: uistratdisplay.h:199
Interval< float > boundingrange_
Definition: uistratdisplay.h:197
uiLabeledSpinBox * stepfld_
Definition: uistratdisplay.h:130
#define mDefSetupMemb(typ, memb)
Definition: commondefs.h:137
uiStratDrawer drawer_
Definition: uistratdisplay.h:127
uiToolBar * tb_
Definition: uistratdisplay.h:194
Definition: mouseevent.h:162
uiStratViewControl * control()
Definition: uistratdisplay.h:113
uiGroup * dispparamgrp_
Definition: uistratdisplay.h:131
StratDispData data_
Definition: uistratdisplay.h:126
Definition: uigraphicsitemimpl.h:214
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Definition: uistratdispdata.h:36
Definition: uistratdisplay.h:103
Definition: uistratdisplay.h:39
Definition: uigraphicsitem.h:142
Definition: uigraphicsview.h:51
Definition: uistratdispdata.h:193
Definition: uitoolbutton.h:22
const StratDispData & data_
Definition: uistratdisplay.h:88
Definition: uigraphicsitemimpl.h:273
Interval< float > maxrg_
Definition: uistratdisplay.h:136
uiGenInput * rangefld_
Definition: uistratdisplay.h:129
uiAxisHandler * xax_
Definition: uistratdisplay.h:85
void setRange(const Interval< float > &rg)
Definition: uistratdisplay.h:178
const uiAxisHandler * xAxis() const
Definition: uistratdisplay.h:54
~uiStratViewControl()
Definition: uistratdisplay.h:176
bool mousepressed_
Definition: uistratdisplay.h:200
uiStratTreeToDisp * uidatagather_
Definition: uistratdisplay.h:122
uiPushButton * viewcolbutton_
Definition: uistratdisplay.h:133
Definition: mouseevent.h:73
Definition: uistratdisplay.h:161
Definition: uigraphicsscene.h:39
uiGraphicsView & viewer_
Definition: uistratdisplay.h:189
Displays a Strat::RefTree.
Definition: uistratreftree.h:33
Geom::Point2D< int > pos_
Definition: mouseevent.h:124

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019