OpendTect-6_4  6.4
uimathexpressionvariable.h
Go to the documentation of this file.
1 #ifndef uimathexpressionvariable_h
2 #define uimathexpressionvariable_h
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: H. Huck
8  Date: Mar 2012
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "uitoolsmod.h"
15 #include "uigroup.h"
16 #include "mathformula.h"
17 #include "propertyref.h"
18 class BufferStringSet;
19 class UnitOfMeasure;
20 namespace Math { class Formula; class Expression; }
21 class uiLabel;
22 class uiUnitSel;
23 class uiGenInput;
24 class uiComboBox;
25 class uiToolButton;
26 
27 
30 public:
31 
33  bool withuom=true,
34  bool withsubinps=false,
35  const Math::SpecVarSet* svs=0);
37 
38  void addInpViewIcon(const char* inm,const char* tooltip,
39  const CallBack&);
40  void setNonSpecInputs(const BufferStringSet&);
41  void setNonSpecSubInputs(const BufferStringSet&);
42 
43  virtual void use(const Math::Formula&);
44  virtual void use(const Math::Expression*);
45 
46  int varIdx() const { return varidx_; }
47  const OD::String& varName() const { return varnm_; }
48  bool hasVarName( const char* nm ) const
49  { return varnm_ == nm; }
50 
51  bool isActive() const { return isactive_; }
52  bool isConst() const { return isconst_; }
53  int specIdx() const { return specidx_; }
54  const char* getInput() const;
55  const UnitOfMeasure* getUnit() const;
56  void fill(Math::Formula&) const;
57 
58  void selectInput(const char*,bool exact=false);
59  void selectSubInput(int);
60  void setUnit(const UnitOfMeasure*);
61  void setUnit(const char*);
62  void setPropType(PropertyRef::StdType);
63 
66 
67  uiGroup* rightMostField();
68  const uiToolButton* viewBut() const { return vwbut_; }
69 
70 protected:
71 
72  void initFlds( CallBacker* ) { updateDisp(); }
73  void inpChg( CallBacker* ) { inpSel.trigger(); }
74  void subInpChg( CallBacker* ) { subInpSel.trigger(); }
75  void showHideVwBut(CallBacker* cb=0);
76 
77  const int varidx_;
81  bool isactive_;
82  bool isconst_;
83  int specidx_;
85 
86  uiGroup* inpgrp_;
93 
94  void updateDisp();
95  void updateInpNms(bool sub);
96  void setActive(bool);
97  void setVariable(const char*,bool);
98 
99 };
100 
101 
102 #endif
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
uiComboBox * inpfld_
Definition: uimathexpressionvariable.h:88
bool isconst_
Definition: uimathexpressionvariable.h:82
Selector for UnitOfMeasure's.
Definition: uiunitsel.h:38
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
bool isActive() const
Definition: uimathexpressionvariable.h:51
void initFlds(CallBacker *)
Definition: uimathexpressionvariable.h:72
const OD::String & varName() const
Definition: uimathexpressionvariable.h:47
uiLabel * inplbl_
Definition: uimathexpressionvariable.h:87
void inpChg(CallBacker *)
Definition: uimathexpressionvariable.h:73
Combo box.
Definition: uicombobox.h:32
Definition: uiparent.h:26
const int varidx_
Definition: uimathexpressionvariable.h:77
bool hasVarName(const char *nm) const
Definition: uimathexpressionvariable.h:48
Set of BufferString objects.
Definition: bufstringset.h:28
Set of special variables for Math Formulae/Expressions.
Definition: mathspecvars.h:47
uiGenInput * constfld_
Definition: uimathexpressionvariable.h:90
Math formula: (expression, inputs, units, calculation, storage).
Definition: mathformula.h:65
bool isactive_
Definition: uimathexpressionvariable.h:81
bool isConst() const
Definition: uimathexpressionvariable.h:52
Notifier< uiMathExpressionVariable > inpSel
Definition: uimathexpressionvariable.h:64
int specidx_
Definition: uimathexpressionvariable.h:83
encapsulates the read-access-only part of strings in OD.
Definition: odstring.h:31
uiGroup * inpgrp_
Definition: uimathexpressionvariable.h:86
General Input Element.
Definition: uigeninput.h:58
Notifier< uiMathExpressionVariable > subInpSel
Definition: uimathexpressionvariable.h:65
void trigger(T &t)
Definition: callback.h:258
Definition: uimathexpressionvariable.h:28
BufferStringSet nonspecinputs_
Definition: uimathexpressionvariable.h:79
Math::SpecVarSet & specvars_
Definition: uimathexpressionvariable.h:84
BufferString varnm_
Definition: uimathexpressionvariable.h:78
Parsed Math expression.
Definition: mathexpression.h:32
void subInpChg(CallBacker *)
Definition: uimathexpressionvariable.h:74
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
uiUnitSel * unfld_
Definition: uimathexpressionvariable.h:91
Definition: uilabel.h:24
const uiToolButton * viewBut() const
Definition: uimathexpressionvariable.h:68
Definition: math2.h:29
Definition: uitoolbutton.h:22
uiComboBox * subinpfld_
Definition: uimathexpressionvariable.h:89
StdType
Definition: propertyref.h:46
int varIdx() const
Definition: uimathexpressionvariable.h:46
CallBacks object-oriented (object + method).
Definition: callback.h:57
BufferStringSet nonspecsubinputs_
Definition: uimathexpressionvariable.h:80
Unit of Measure.
Definition: unitofmeasure.h:35
int specIdx() const
Definition: uimathexpressionvariable.h:53
uiToolButton * vwbut_
Definition: uimathexpressionvariable.h:92

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