OpendTect  6.3
uiwindowfuncseldlg.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Satyaki Maitra
8  Date: August 2007
9 ________________________________________________________________________
10 
11 -*/
12 
13 
14 #include "uitoolsmod.h"
15 #include "uitoolsmod.h"
16 #include "uidialog.h"
17 #include "uifunctiondisplay.h"
18 #include "uigroup.h"
19 #include "uibutton.h"
20 #include "bufstringset.h"
21 #include "color.h"
22 #include "mathfunc.h"
23 #include "dbkey.h"
24 #include "arrayndalgo.h"
25 #include "arrayndimpl.h"
26 #include "uistring.h"
27 
28 class uiAxisHandler;
29 class uiGenInput;
31 class uiFuncTaperDisp;
32 class uiListBox;
33 class uiRectItem;
34 class uiWorld2Ui;
35 class uiSliceSelDlg;
36 
37 class ArrayNDWindow;
38 class WindowFunction;
39 
44 
45 public:
46  mStruct(uiTools) Setup
47  {
48  Setup()
49  : xaxrg_(-1.2,1.2,0.25)
50  , yaxrg_(0,1,0.25)
51  , funcrg_(-1.2,1.2)
52  {}
53 
56  mDefSetupMemb(const char*,name)
57  mDefSetupMemb(uiString,xaxcaption)
58  mDefSetupMemb(uiString,yaxcaption)
60  };
61 
62  mStruct(uiTools) DrawFunction
63  {
64  DrawFunction( const FloatMathFunction* f )
65  : color_(Color::DgbColor())
66  , mathfunc_(f)
67  {}
68 
69  const FloatMathFunction* mathfunc_;
70  TypeSet<uiPoint> pointlist_;
71  Color color_;
72  };
73 
76 
77  void addFunction(DrawFunction* f) { functions_ += f; }
78  void clearFunctions(){ deepErase( functions_ ); }
79  void clearFunction(int idx);
80  void draw(CallBacker*);
81  Interval<float>& getFunctionRange() { return funcrg_; }
82  void setSelItems(TypeSet<int> s) { selitemsidx_ = s; }
83  void setFunctionRange(Interval<float>& rg) {funcrg_ = rg;}
84  void setUpAxis();
85 
86 
87 protected:
88 
90  float variable_;
98 
99  void createLine(DrawFunction*);
100  void setFrame();
101 };
102 
103 
104 mExpClass(uiTools) uiFuncSelDraw : public uiGroup
106 public:
107 
109 
111 
112  void addFunction(const char* nm=0, FloatMathFunction* f=0,
113  bool withcolor=true);
114  int getListSize() const;
115  int getNrSel() const;
116  const char* getCurrentListName() const;
117  void getSelectedItems(TypeSet<int>&) const;
118  bool isSelected(int) const;
119  void removeItem(int);
120  int removeLastItem();
121  void setAsCurrent(const char*);
122  void setSelected(int);
123  void setFunctionRange(Interval<float>);
124  void setAxisRange(Interval<float>);
125 
126  void funcSelChg(CallBacker*);
127 
128 protected:
129 
134 };
135 
136 
140 public:
141 
142  uiWindowFuncSelDlg(uiParent*,const char*,float);
143 
144  void funcSelChg(CallBacker*);
145  const char* getCurrentWindowName() const;
146  void setCurrentWindowFunc(const char*,float);
147  void setVariable(float);
148  float getVariable();
149 
150 protected:
151 
153  float variable_;
158 
159  WindowFunction* getWindowFuncByName(const char*);
160 };
Class to provide coordinate conversion between a cartesian coordinate system (or any other transforme...
Definition: uiworld2ui.h:53
Definition: uigroup.h:53
#define mExpClass(module)
Definition: commondefs.h:157
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:182
Definition: uifreqtaper.h:64
uiWorld2Ui * transform_
Definition: uiwindowfuncseldlg.h:91
void addFunction(DrawFunction *f)
Definition: uiwindowfuncseldlg.h:77
FixedString Setup()
Definition: keystrs.h:113
Definition: uiwindowfuncseldlg.h:104
float variable_
Definition: uiwindowfuncseldlg.h:153
#define mStruct(module)
Definition: commondefs.h:162
#define mODTextTranslationClass(clss)
Definition: uistring.h:37
Tapers the N-dimentional ArrayND with a windowFunction.
Definition: arrayndalgo.h:870
ObjectSet< FloatMathFunction > mathfunc_
Definition: uiwindowfuncseldlg.h:133
ObjectSet< DrawFunction > functions_
Definition: uiwindowfuncseldlg.h:96
Handles an axis on a plot.
Definition: uiaxishandler.h:50
uiAxisHandler * xax_
Definition: uiwindowfuncseldlg.h:93
Mathematical function.
Definition: mathfunc.h:59
Definition: uislicesel.h:91
Definition: uiwindowfuncseldlg.h:138
Definition: uistring.h:88
Definition: uiparent.h:24
bool isfrequency_
Definition: uiwindowfuncseldlg.h:154
Set of BufferString objects.
Definition: bufstringset.h:25
Definition: uidialog.h:40
Interval< float > & getFunctionRange()
Definition: uiwindowfuncseldlg.h:81
List Box.
Definition: uilistbox.h:73
Set of (small) copyable elements.
Definition: commontypes.h:26
Definition: uiwindowfuncseldlg.h:42
Definition: uigraphicsitem.h:154
General Input Element.
Definition: uigeninput.h:56
Definition: uigraphicsitemimpl.h:259
uiAxisHandler * yax_
Definition: uiwindowfuncseldlg.h:94
TypeSet< int > selitemsidx_
Definition: uiwindowfuncseldlg.h:97
#define mDefSetupMemb(typ, memb)
Definition: commondefs.h:129
TypeSet< Color > colors_
Definition: uiwindowfuncseldlg.h:132
uiFuncSelDraw * funcdrawer_
Definition: uiwindowfuncseldlg.h:156
virtual bool setVariable(float)
Definition: windowfunction.h:31
void setSelItems(TypeSet< int > s)
Definition: uiwindowfuncseldlg.h:82
BufferStringSet funcnames_
Definition: uiwindowfuncseldlg.h:152
Notifier< uiFuncSelDraw > funclistselChged
Definition: uiwindowfuncseldlg.h:110
ObjectSet< WindowFunction > winfunc_
Definition: uiwindowfuncseldlg.h:157
static Color DgbColor()
Definition: color.h:78
void setFunctionRange(Interval< float > &rg)
Definition: uiwindowfuncseldlg.h:83
uiGraphicsItemGroup * polyitemgrp_
Definition: uiwindowfuncseldlg.h:95
uiFunctionDrawer * view_
Definition: uiwindowfuncseldlg.h:130
Definition: uigraphicsview.h:49
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:24
float variable_
Definition: uiwindowfuncseldlg.h:90
virtual const char * name() const =0
Base class for window functions. The inheriting classes will give a value between 0 and 1 in the inte...
Definition: windowfunction.h:25
uiListBox * funclistfld_
Definition: uiwindowfuncseldlg.h:131
uiRectItem * borderrectitem_
Definition: uiwindowfuncseldlg.h:92
Interval< float > funcrg_
Definition: uiwindowfuncseldlg.h:89
uiGenInput * varinpfld_
Definition: uiwindowfuncseldlg.h:155
virtual float getVariable() const
Definition: windowfunction.h:30
void deepErase(ObjectSet< T > &os)
empty the ObjectSet deleting all objects pointed to.
Definition: objectset.h:122
void clearFunctions()
Definition: uiwindowfuncseldlg.h:78

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