OpendTect-6_4  6.4
uifreqtaper.h
Go to the documentation of this file.
1 #ifndef uifreqtaper_h
2 #define uifreqtaper_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bruno
9  Date: Nov 2009
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uiseismod.h"
16 #include "uiseismod.h"
17 #include "uidialog.h"
18 #include "uifunctiondisplay.h"
19 #include "uiwindowfunctionsel.h"
20 #include "uibutton.h"
21 #include "survinfo.h"
22 #include "arrayndalgo.h"
23 #include <arrayndimpl.h>
24 #include "uistring.h"
25 
26 class uiGenInput;
27 class uiFuncTaperDisp;
28 class uiSliceSelDlg;
29 class uiSlider;
30 class uiFreqTaperGrp;
31 
32 class ArrayNDWindow;
33 class TrcKeyZSampling;
34 
35 
36 mStruct(uiSeis) FreqTaperSetup
37 {
38  FreqTaperSetup();
39  FreqTaperSetup(const FreqTaperSetup&);
40  ~FreqTaperSetup();
41 
42  const char* seisnm_;
43  const char* attrnm_; //2D
44  bool hasmin_;
45  bool hasmax_;
46  Interval<float> minfreqrg_;
47  Interval<float> maxfreqrg_;
48  bool allfreqssetable_;
49  MultiID multiid_;
50 };
51 
52 
53 mStruct(uiSeis) TaperData
54 {
55  TaperData()
56  : window_(0)
57  , paramval_(1)
58  {}
59 
60  Interval<float> rg_;
61  Interval<float> refrg_;
62 
63  ArrayNDWindow* window_;
64  int winsz_;
65  float paramval_;
66  float slope_;
67 };
68 
69 
72 public:
73 
75  {
77  : is2sided_(false)
78  , datasz_((int)(0.5/SI().zStep()))
79  , logscale_(false)
80  {
81  xaxcaption_ = uiStrings::phrJoinStrings(
82  uiStrings::sFrequency(), tr("(Hz)"));
83  yaxcaption_ = tr("Gain Factor (dB)");
84  noxgridline_ = true;
85  noygridline_ = true;
86  ywidth_ = 2;
87  ycol_.set(200,0,0);
88  y2col_.set(0,0,220);
89  }
90 
91  mDefSetupMemb(int,datasz);
92  mDefSetupMemb(uiString,xaxcaption);
93  mDefSetupMemb(uiString,yaxcaption);
96  mDefSetupMemb(bool,is2sided);
97  mDefSetupMemb(bool,logscale);
98  };
99 
100  uiFuncTaperDisp(uiParent*,const Setup&);
101  ~uiFuncTaperDisp();
102 
103  void setWindows(float,float rightvar=0);
104  void setFunction(Array1DImpl<float>&,Interval<float>);
105 
106  ArrayNDWindow* window() const { return window_; }
107 
108  float* getWinValues() const
109  { return window_ ? window_->getValues() : 0; }
110  float* getFuncValues() const
111  { return funcvals_ ? funcvals_->getData() : 0; }
112 
113  void adaptFreqRangesToDataSize(bool,bool);
114  void taperChged(CallBacker*);
115 
116  TaperData& leftTaperData() { return leftd_; }
117  TaperData& rightTaperData() { return rightd_; }
118 
119  int dataSize() const { return datasz_; }
120 
122 
123 protected:
124 
125  TaperData leftd_;
126  TaperData rightd_;
127 
129 
133 
134  bool is2sided_;
135  bool logscale_;
136  int datasz_;
138 };
139 
140 
141 
144 
145 public:
147  const FreqTaperSetup&,
148  uiFuncTaperDisp*);
150 
151 
152  void setFreqRange(Interval<float>);
153  Interval<float> getFreqRange() const;
154  void taperChged(CallBacker*);
155 
156 protected :
157 
158  TaperData td1_;
159  TaperData td2_;
160 
167 
168  bool hasmin_;
169  bool hasmax_;
171  int datasz_;
173 
174  void setSlopeFromFreq();
175  void setPercentsFromFreq();
176  void setFreqFromSlope(float);
177 
178  void freqChoiceChged(CallBacker*);
179  void freqChanged(CallBacker*);
180  void putToScreen(CallBacker*);
181  void sliderChanged(CallBacker*);
182  void slopeChanged(CallBacker*);
183 };
184 
185 
186 
189 public:
190 
191  uiFreqTaperDlg(uiParent*,const FreqTaperSetup&);
192  ~uiFreqTaperDlg();
193 
195  { return tapergrp_->getFreqRange(); }
196 
197 protected:
198 
202 
203  const char* seisnm_;
204  const char* attrnm_;
209 
210  void previewPushed(CallBacker*);
211 };
212 
213 
214 
217 public:
218  uiFreqTaperSel(uiParent*,const Setup&,
219  const FreqTaperSetup&);
220 
221  Interval<float> freqValues() const;
222 
223  void setMultiID( const MultiID& multiid )
224  { freqsetup_.multiid_ = multiid; }
225  void setIsMinMaxFreq(bool,bool);
226  void setInputFreqValue(float,int);
227  void setRefFreqs(Interval<float>);
228 
229 protected :
230 
232  FreqTaperSetup freqsetup_;
233 
234  void winfuncseldlgCB(CallBacker*);
235  void windowClosed(CallBacker*);
236  void setSelFreqs(CallBacker*);
237 };
238 
239 #endif
Definition: uigroup.h:54
#define mExpClass(module)
Definition: commondefs.h:160
Definition: uifreqtaper.h:215
bool logscale_
Definition: uifreqtaper.h:135
uiSlider * sliderfld_
Definition: uifreqtaper.h:165
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
Array1DImpl< float > * funcvals_
Definition: uifreqtaper.h:130
Definition: uifreqtaper.h:70
TaperData rightd_
Definition: uifreqtaper.h:126
FixedString Setup()
Definition: keystrs.h:116
Array1DImpl< float > * orgfuncvals_
Definition: uifreqtaper.h:131
Definition: uislider.h:42
is the base class for all buttons.
Definition: uibutton.h:83
const char * seisnm_
Definition: uifreqtaper.h:203
#define mStruct(module)
Definition: commondefs.h:165
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
int datasz_
Definition: uifreqtaper.h:136
Tapers the N-dimentional ArrayND with a windowFunction.
Definition: arrayndalgo.h:309
ArrayNDWindow * window() const
Definition: uifreqtaper.h:106
TaperData td2_
Definition: uifreqtaper.h:159
Interval< float > funcdisprg_
Definition: uifreqtaper.h:132
TaperData td1_
Definition: uifreqtaper.h:158
Definition: uislicesel.h:93
Definition: uistring.h:89
Definition: uiparent.h:26
uiFreqTaperDlg * freqtaperdlg_
Definition: uifreqtaper.h:231
Definition: uifreqtaper.h:74
bool hasmax_
Definition: uifreqtaper.h:169
Definition: uidialog.h:42
Definition: uifreqtaper.h:142
uiSliceSelDlg * posdlg_
Definition: uifreqtaper.h:206
Notifier< uiFuncTaperDisp > taperChanged
Definition: uifreqtaper.h:121
uiGenInput * varinpfld_
Definition: uifreqtaper.h:161
uiFuncTaperDisp * drawer_
Definition: uifreqtaper.h:200
uiFuncTaperDisp * drawer_
Definition: uifreqtaper.h:166
Hor+Vert sampling in 3D surveys.
Definition: trckeyzsampling.h:35
uiPushButton * previewfld_
Definition: uifreqtaper.h:205
General Input Element.
Definition: uigeninput.h:58
TaperData leftd_
Definition: uifreqtaper.h:125
displays a function of (X,Y) pairs on a canvas - optionally a Y2.
Definition: uifunctiondisplay.h:38
MultiID seisid_
Definition: uifreqtaper.h:208
const char * attrnm_
Definition: uifreqtaper.h:204
uiFreqTaperGrp * tapergrp_
Definition: uifreqtaper.h:199
#define mDefSetupMemb(typ, memb)
Definition: commondefs.h:137
~uiFreqTaperGrp()
Definition: uifreqtaper.h:149
FreqTaperSetup freqsetup_
Definition: uifreqtaper.h:232
uiGenInput * inffreqfld_
Definition: uifreqtaper.h:163
bool is2sided_
Definition: uifreqtaper.h:134
TaperData & rightTaperData()
Definition: uifreqtaper.h:117
Setup()
Definition: uifreqtaper.h:76
const SurveyInfo & SI()
bool hasmin_
Definition: uifreqtaper.h:168
int datasz_
Definition: uifreqtaper.h:171
int orgdatasz_
Definition: uifreqtaper.h:137
Array1DImpl< float > * funcvals_
Definition: uifreqtaper.h:201
Definition: uiwindowfunctionsel.h:28
TrcKeyZSampling * tkzs_
Definition: uifreqtaper.h:207
Interval< float > getFreqRange() const
Definition: uifreqtaper.h:194
bool isminactive_
Definition: uifreqtaper.h:170
static uiString phrJoinStrings(const uiString &a, const uiString &b)
"
void setMultiID(const MultiID &multiid)
Definition: uifreqtaper.h:223
uiGenInput * supfreqfld_
Definition: uifreqtaper.h:164
int dataSize() const
Definition: uifreqtaper.h:119
uiGenInput * freqinpfld_
Definition: uifreqtaper.h:162
bool allfreqssetable_
Definition: uifreqtaper.h:172
Compound key consisting of ints.
Definition: multiid.h:25
ArrayNDWindow * window_
Definition: uifreqtaper.h:128
TaperData & leftTaperData()
Definition: uifreqtaper.h:116
float * getFuncValues() const
Definition: uifreqtaper.h:110
static uiString sFrequency(int num=1)
float * getWinValues() const
Definition: uifreqtaper.h:108
Definition: uifreqtaper.h:187

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