OpendTect-6_4  6.4
uiflatviewstdcontrol.h
Go to the documentation of this file.
1 #ifndef uiflatviewstdcontrol_h
2 #define uiflatviewstdcontrol_h
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Bert
8  Date: Mar 2007
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "uiflatviewmod.h"
15 #include "uiflatviewcontrol.h"
16 #include "uidialog.h"
17 #include "menuhandler.h"
18 #include "helpview.h"
19 
20 class uiCheckBox;
21 class uiMenuHandler;
22 class uiToolButton;
23 class uiFlatViewColTabEd;
24 class uiGenInput;
25 class uiToolBar;
26 
27 
30 public:
31  uiFlatViewZoomLevelDlg(uiParent*,float& x1pospercm,
32  float& x2pospercm,bool isvertical);
34 
35 protected:
36 
37  float& x1pospercm_;
38  float& x2pospercm_;
39 
43 
44  void finalizeDoneCB(CallBacker*);
45  void unitChgCB(CallBacker*);
46  bool acceptOK(CallBacker*);
47 };
48 
49 
56 public:
57 
58  struct Setup
59  {
60  Setup( uiParent* p=0 )
61  : parent_(p)
62  , withcoltabed_(true)
63  , withedit_(false)
64  , withhanddrag_(true)
65  , withsnapshot_(true)
66  , withflip_(true)
67  , withrubber_(true)
68  , withzoombut_(true)
69  , withscalebarbut_(false)
70  , isvertical_(false)
71  , withfixedaspectratio_(false)
72  , withhomebutton_(false)
73  , managecoltab_(true)
74  , initialx1pospercm_(mUdf(float))
75  , initialx2pospercm_(mUdf(float))
76  , initialcentre_(uiWorldPoint::udf())
77  , tba_(-1) {}
78 
79  mDefSetupMemb(uiParent*,parent)
80  mDefSetupMemb(bool,withcoltabed)
81  mDefSetupMemb(bool,withedit)
82  mDefSetupMemb(bool,withhanddrag)
83  mDefSetupMemb(int,tba)
84  mDefSetupMemb(HelpKey,helpkey)
85  mDefSetupMemb(bool,withflip)
86  mDefSetupMemb(bool,withsnapshot)
87  mDefSetupMemb(bool,withrubber)
88  mDefSetupMemb(bool,withzoombut)
89  mDefSetupMemb(bool,isvertical)
90  mDefSetupMemb(bool,withfixedaspectratio)
91  mDefSetupMemb(bool,managecoltab)
92  mDefSetupMemb(bool,withhomebutton)
93  mDefSetupMemb(float,initialx1pospercm)
94  mDefSetupMemb(float,initialx2pospercm)
95  mDefSetupMemb(bool,withscalebarbut)
96  mDefSetupMemb(uiWorldPoint,initialcentre);
97  };
98 
101  virtual uiToolBar* toolBar() { return tb_; }
102  uiToolBar* editToolBar() { return edittb_; }
103  virtual uiFlatViewColTabEd* colTabEd() { return ctabed_; }
104  void setEditMode(bool yn);
105  float getCurrentPosPerCM(bool forx1) const;
106 
107  static void setGlobalZoomLevel(float x1pospercm, float x2pospercm,
108  bool isvertical);
109  static void getGlobalZoomLevel(float& x1pospercm, float& x2pospercm,
110  bool isvertical);
111  bool isEditModeOn() const;
112  bool isRubberBandOn() const;
113  NotifierAccess* editPushed();
114 
115 protected:
116 
119 
122 
137 
140 
141  const Setup setup_;
142 
143  virtual void finalPrepare();
144  void clearToolBar();
145  void updatePosButtonStates();
146  void updateZoomLevel(float x1pospercm,float x2pospercm);
147  void doZoom(bool zoomin,bool onlyvertzoom,uiFlatViewer&);
148  void setViewToCustomZoomLevel(uiFlatViewer&);
149 
150  virtual void coltabChg(CallBacker*);
151  virtual void dispChgCB(CallBacker*);
152  virtual void zoomChgCB(CallBacker*);
153  virtual void rubBandUsedCB(CallBacker*);
154  virtual void dragModeCB(CallBacker*);
155  void editModeCB(CallBacker*);
156  void flipCB(CallBacker*);
157  void helpCB(CallBacker*);
158  void handDragStarted(CallBacker*);
159  void handDragging(CallBacker*);
160  void handDragged(CallBacker*);
161  void aspectRatioCB(CallBacker*);
162  void keyPressCB(CallBacker*);
163  void homeZoomOptSelCB(CallBacker*);
164  void fitToScreenCB(CallBacker*);
165  void viewScaleBarCB(CallBacker*);
166  virtual void parsCB(CallBacker*);
167  virtual void vwrAdded(CallBacker*) {}
168  virtual void wheelMoveCB(CallBacker*);
169  virtual void zoomCB(CallBacker*);
170  virtual void pinchZoomCB(CallBacker*);
171  virtual void cancelZoomCB(CallBacker*);
172  virtual void gotoHomeZoomCB(CallBacker*);
173 
174  virtual bool handleUserClick(int vwridx);
175 
178  void createMenuCB(CallBacker*);
179  void handleMenuCB(CallBacker*);
180 
182 
183  void setVwrCursor(uiFlatViewer&,const MouseCursor&);
184 };
185 
186 #endif
Definition: uitoolbar.h:31
uiToolButton * editbut_
Definition: uiflatviewstdcontrol.h:136
#define mExpClass(module)
Definition: commondefs.h:160
virtual uiFlatViewColTabEd * colTabEd()
Definition: uiflatviewstdcontrol.h:103
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
float defx1pospercm_
Definition: uiflatviewstdcontrol.h:120
uiToolButton * gotohomezoombut_
Definition: uiflatviewstdcontrol.h:132
FlatView color table editor.
Definition: uiflatviewcoltabed.h:26
Definition of a mouse cursor, can be either a predefined shape (from the enum, or a file...
Definition: mousecursor.h:26
virtual void vwrAdded(CallBacker *)
Definition: uiflatviewstdcontrol.h:167
uiToolBar * edittb_
Definition: uiflatviewstdcontrol.h:124
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
uiToolButton * fittoscrnbut_
Definition: uiflatviewstdcontrol.h:134
Interface class for Notifier. See comments there.
Definition: callback.h:161
uiGenInput * x1fld_
Definition: uiflatviewstdcontrol.h:40
HelpKey helpkey_
Definition: uiflatviewstdcontrol.h:181
Definition: uiparent.h:26
uiGenInput * x2fld_
Definition: uiflatviewstdcontrol.h:41
Definition: helpview.h:49
uiToolButton * zoominbut_
Definition: uiflatviewstdcontrol.h:126
uiToolButton * vertzoomoutbut_
Definition: uiflatviewstdcontrol.h:129
Definition: uidialog.h:42
Definition: uimenuhandler.h:27
uiToolBar * tb_
Definition: uiflatviewstdcontrol.h:123
uiToolButton * rubbandzoombut_
Definition: uiflatviewstdcontrol.h:125
float & x2pospercm_
Definition: uiflatviewstdcontrol.h:38
Definition: menuhandler.h:76
uiToolButton * cancelzoombut_
Definition: uiflatviewstdcontrol.h:130
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
Setup(uiParent *p=0)
Definition: uiflatviewstdcontrol.h:60
uiToolButton * scalebarbut_
Definition: uiflatviewstdcontrol.h:133
General Input Element.
Definition: uigeninput.h:58
The standard tools to control uiFlatViewer(s).
Definition: uiflatviewstdcontrol.h:54
uiToolBar * editToolBar()
Definition: uiflatviewstdcontrol.h:102
#define mDefSetupMemb(typ, memb)
Definition: commondefs.h:137
Tools to control uiFlatViewer(s).
Definition: uiflatviewcontrol.h:29
bool mousepressed_
Definition: uiflatviewstdcontrol.h:117
uiToolButton * sethomezoombut_
Definition: uiflatviewstdcontrol.h:131
Definition: uiflatviewstdcontrol.h:28
float defx2pospercm_
Definition: uiflatviewstdcontrol.h:121
MenuItem propertiesmnuitem_
Definition: uiflatviewstdcontrol.h:177
uiPoint mousedownpt_
Definition: uiflatviewstdcontrol.h:118
float & x1pospercm_
Definition: uiflatviewstdcontrol.h:37
uiMenuHandler & menu_
Definition: uiflatviewstdcontrol.h:176
uiToolButton * zoomoutbut_
Definition: uiflatviewstdcontrol.h:127
Definition: uitoolbutton.h:22
uiToolButton * parsbut_
Definition: uiflatviewstdcontrol.h:135
uiFlatViewColTabEd * ctabed_
Definition: uiflatviewstdcontrol.h:139
Definition: uibutton.h:134
uiFlatViewer & vwr_
Definition: uiflatviewstdcontrol.h:138
Fulfills the FlatView::Viewer specifications using 'ui' classes.
Definition: uiflatviewer.h:33
uiToolButton * vertzoominbut_
Definition: uiflatviewstdcontrol.h:128
uiCheckBox * saveglobalfld_
Definition: uiflatviewstdcontrol.h:42
Definition: uiflatviewstdcontrol.h:58
const Setup setup_
Definition: uiflatviewstdcontrol.h:141

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