OpendTect-6_4  6.4
uimathformula.h
Go to the documentation of this file.
1 #ifndef uimathformula_h
2 #define uimathformula_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert
9  Date: Apr 2014
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uiiomod.h"
16 #include "uigroup.h"
17 #include "uistrings.h"
18 #include "mathformula.h"
19 #include "propertyref.h"
20 class uiButton;
21 class uiUnitSel;
22 class uiToolButton;
23 class uiToolButtonSetup;
24 class uiMathExpression;
26 class CtxtIOObj;
27 class UnitOfMeasure;
28 namespace Math { class Form; }
29 
30 
31 /* edits a Math::Formula */
32 
33 
36 public:
37 
39  {
40  public:
42  : label_(lbl)
43  , maxnrinps_(6)
44  , withsubinps_(false)
45  , withunits_(true)
46  , proptype_(PropertyRef::Other) {}
47 
48  mDefSetupMemb(uiString,label);
49  mDefSetupMemb(int,maxnrinps);
50  mDefSetupMemb(BufferString,stortype); // if empty, no I/O
51  mDefSetupMemb(bool,withsubinps);
52  mDefSetupMemb(bool,withunits);
53  mDefSetupMemb(PropertyRef::StdType,proptype); // used if withunits_
54 
55  };
56 
57  uiMathFormula(uiParent*,Math::Formula&,const Setup&);
58  ~uiMathFormula();
59 
60 
61  void setNonSpecInputs(const BufferStringSet&,int iinp=-1);
62  void setNonSpecSubInputs(const BufferStringSet&,int iinp=-1);
63 
64  bool setText(const char*);
65  const char* text() const;
66 
67  bool useForm(const TypeSet<PropertyRef::StdType>* inptyps=0);
68  bool updateForm() const;
69 
70  // shortcuts for things available in form
71  int nrInputs() const;
72  const char* getInput(int) const;
73  bool isSpec(int) const;
74  bool isConst(int) const;
75  double getConstVal(int) const;
76  const UnitOfMeasure* getUnit() const;
77 
78  uiButton* addButton(const uiToolButtonSetup&);
79  void addInpViewIcon(const char* icnm,const char* tooltip,
80  const CallBack&);
81 
86 
87  uiMathExpression* exprFld() { return exprfld_; }
88  int nrInpFlds() const { return inpflds_.size(); }
89  uiMathExpressionVariable* inpFld( int idx ) { return inpflds_[idx]; }
90  uiUnitSel* unitFld() { return unitfld_; }
91  int inpSelNotifNr() const { return notifinpnr_; }
92  int vwLogInpNr(CallBacker*) const;
93  bool checkValidNrInputs() const;
94 
95 protected:
96 
105 
106  Setup setup_;
109 
110  BufferString getIOFileName(bool forread);
111  bool setNotifInpNr(const CallBacker*);
112 
113  void initFlds(CallBacker*);
114  void formSetCB(CallBacker*);
115  void inpSetCB(CallBacker*);
116  void subInpSetCB(CallBacker*);
117  void formUnitSetCB(CallBacker*);
118  void recButPush(CallBacker*);
119  void readReq(CallBacker*);
120  void writeReq(CallBacker*);
121 
122 };
123 
124 
125 #endif
Definition: uigroup.h:54
#define mExpClass(module)
Definition: commondefs.h:160
uiToolButton * savebut_
Definition: uimathformula.h:103
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
CtxtIOObj & ctio_
Definition: uimathformula.h:108
int notifinpnr_
Definition: uimathformula.h:104
Selector for UnitOfMeasure&#39;s.
Definition: uiunitsel.h:38
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
Setup setup_
Definition: uimathformula.h:106
Ref Data for a (usually petrophysical) property.
Definition: propertyref.h:42
Notifier< uiMathFormula > subInpSet
Definition: uimathformula.h:84
Notifier< uiMathFormula > inpSet
Definition: uimathformula.h:83
uiToolButton * recbut_
Definition: uimathformula.h:101
Definition: odinst.h:42
Definition: uistring.h:89
Definition: uiparent.h:26
uiMathExpression * exprfld_
Definition: uimathformula.h:98
Set of BufferString objects.
Definition: bufstringset.h:28
Holds an IOObjCtxt plus a pointer to an IOObj and/or an IOPar.
Definition: ctxtioobj.h:142
uiUnitSel * unitFld()
Definition: uimathformula.h:90
Definition: uitoolbutton.h:76
Math formula: (expression, inputs, units, calculation, storage).
Definition: mathformula.h:65
Set of (small) copyable elements.
Definition: commontypes.h:30
TypeSet< double > recvals_
Definition: uimathformula.h:107
uiMathExpression * exprFld()
Definition: uimathformula.h:87
uiMathExpressionVariable * inpFld(int idx)
Definition: uimathformula.h:89
Definition: uimathexpressionvariable.h:28
#define mDefSetupMemb(typ, memb)
Definition: commondefs.h:137
Notifier< uiMathFormula > formUnitSet
Definition: uimathformula.h:85
Notifier< uiMathFormula > formSet
Definition: uimathformula.h:82
Definition: uimathformula.h:34
Math::Formula & form_
Definition: uimathformula.h:97
int nrInpFlds() const
Definition: uimathformula.h:88
uiUnitSel * unitfld_
Definition: uimathformula.h:100
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
ObjectSet< uiMathExpressionVariable > inpflds_
Definition: uimathformula.h:99
int inpSelNotifNr() const
Definition: uimathformula.h:91
Definition: math2.h:29
Definition: uitoolbutton.h:22
StdType
Definition: propertyref.h:46
Definition: uimathformula.h:38
Definition: uimathexpression.h:26
static uiString sEmptyString()
Definition: uistrings.h:286
CallBacks object-oriented (object + method).
Definition: callback.h:57
Setup(const uiString &lbl=uiStrings::sEmptyString())
Definition: uimathformula.h:41
Unit of Measure.
Definition: unitofmeasure.h:35
uiToolButton * openbut_
Definition: uimathformula.h:102

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