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

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