OpendTect-6_4
6.4
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
od6.4.5
include
uiCmdDriver
cmdfunction.h
Go to the documentation of this file.
1
#ifndef cmdfunction_h
2
#define cmdfunction_h
3
4
/*+
5
________________________________________________________________________
6
7
(C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8
Author: Jaap Glas
9
Date: April 2011
10
RCS: $Id$
11
________________________________________________________________________
12
13
-*/
14
15
#include "uicmddrivermod.h"
16
#include "
bufstringset.h
"
17
#include "
factory.h
"
18
19
20
class
uiMainWin
;
21
22
namespace
CmdDrive
23
{
24
25
class
CmdDriver;
26
class
WildcardManager;
27
28
mExpClass
(uiCmdDriver)
Function
29
{
30
public
:
31
32
mDefineFactory1ParamInClass
( Function,
const
CmdDriver
&, factory );
33
static
void
initStandardFunctions();
34
static
BufferString
factoryKey(
const
char
* name);
35
36
Function
(
const
CmdDriver
& cmddrv)
37
: drv_(cmddrv)
38
{}
39
virtual
~Function
() {}
40
41
virtual
const
char
* name()
const
=0;
42
virtual
bool
eval(
const
BufferStringSet
& args,
43
BufferString
& res)
const
=0;
44
45
46
protected
:
47
48
static
BufferString
createFactoryKey(
const
char
* keyword);
49
50
const
CmdDriver
&
drv_
;
51
52
bool
openQDlg()
const
;
53
const
uiMainWin
* curWin()
const
;
54
const
uiMainWin
* applWin()
const
;
55
56
const
WildcardManager
& wildcardMan()
const
;
57
};
58
59
60
#define mStartDeclFunClassNoEval(funkey,parentclass) \
61
\
62
mExpClass(uiCmdDriver) funkey##Func : public parentclass \
63
{ \
64
public: \
65
funkey##Func(const CmdDriver& cmddrv) \
66
: parentclass(cmddrv) \
67
{ \
68
name_ = keyWord(); \
69
*name_.getCStr() = mCast(char,tolower(*name_.buf())); \
70
} \
71
\
72
static const char* keyWord() { return #funkey; } \
73
virtual const char* name() const { return name_; } \
74
protected: \
75
BufferString name_;
76
77
78
#define mStartDeclFunClass(funkey,parentclass) \
79
\
80
mStartDeclFunClassNoEval(funkey,parentclass) \
81
public: \
82
virtual bool eval(const BufferStringSet& args, \
83
BufferString& res) const; \
84
\
85
static Function* createInstance(const CmdDriver& cmddrv) \
86
{ return new funkey##Func(cmddrv); } \
87
static void initClass() \
88
{ factory().addCreator( createInstance, \
89
createFactoryKey(keyWord()) ); }
90
91
#define mEndDeclFunClass \
92
};
93
94
95
mStartDeclFunClass
(
Abs
,
Function
)
mEndDeclFunClass
96
mStartDeclFunClass
( Asin,
Function
)
mEndDeclFunClass
97
mStartDeclFunClass
( Acos,
Function
)
mEndDeclFunClass
98
mStartDeclFunClass
( Atan,
Function
)
mEndDeclFunClass
99
mStartDeclFunClass
(
Atan2
,
Function
)
mEndDeclFunClass
100
mStartDeclFunClass
(
Ceil
,
Function
)
mEndDeclFunClass
101
mStartDeclFunClass
( Cos,
Function
)
mEndDeclFunClass
102
mStartDeclFunClass
(
Exp
,
Function
)
mEndDeclFunClass
103
mStartDeclFunClass
(
Floor
,
Function
)
mEndDeclFunClass
104
mStartDeclFunClass
( Ln,
Function
)
mEndDeclFunClass
105
mStartDeclFunClass
(
Log
,
Function
)
mEndDeclFunClass
106
mStartDeclFunClass
( Rand,
Function
)
mEndDeclFunClass
107
mStartDeclFunClass
( RandG,
Function
)
mEndDeclFunClass
108
mStartDeclFunClass
( Round,
Function
)
mEndDeclFunClass
109
mStartDeclFunClass
( Sgn,
Function
)
mEndDeclFunClass
110
mStartDeclFunClass
( Sin,
Function
)
mEndDeclFunClass
111
mStartDeclFunClass
(
Sqrt
,
Function
)
mEndDeclFunClass
112
mStartDeclFunClass
( Tan,
Function
)
mEndDeclFunClass
113
mStartDeclFunClass
( Trunc,
Function
)
mEndDeclFunClass
114
115
mStartDeclFunClass
( Avg,
Function
)
mEndDeclFunClass
116
mStartDeclFunClass
(
Max
,
Function
)
mEndDeclFunClass
117
mStartDeclFunClass
( Med,
Function
)
mEndDeclFunClass
118
mStartDeclFunClass
(
Min
,
Function
)
mEndDeclFunClass
119
mStartDeclFunClass
(
Sum
,
Function
)
mEndDeclFunClass
120
mStartDeclFunClass
( Var,
Function
)
mEndDeclFunClass
121
122
mStartDeclFunClass
( IsAlNum,
Function
)
mEndDeclFunClass
123
mStartDeclFunClass
( IsAlpha,
Function
)
mEndDeclFunClass
124
mStartDeclFunClass
( IsDigit,
Function
)
mEndDeclFunClass
125
mStartDeclFunClass
( IsLower,
Function
)
mEndDeclFunClass
126
mStartDeclFunClass
( IsSpace,
Function
)
mEndDeclFunClass
127
mStartDeclFunClass
( IsUpper,
Function
)
mEndDeclFunClass
128
129
mStartDeclFunClass
( ToLower,
Function
)
mEndDeclFunClass
130
mStartDeclFunClass
( ToUpper,
Function
)
mEndDeclFunClass
131
132
mStartDeclFunClass
( IsNumber,
Function
)
mEndDeclFunClass
133
mStartDeclFunClass
( IsInteger,
Function
)
mEndDeclFunClass
134
135
mStartDeclFunClass
( StrCat,
Function
)
mEndDeclFunClass
136
mStartDeclFunClass
( StrLen,
Function
)
mEndDeclFunClass
137
mStartDeclFunClass
( StrSel,
Function
)
mEndDeclFunClass
138
139
mStartDeclFunClass
( SepStrCat,
Function
)
mEndDeclFunClass
140
mStartDeclFunClass
( SepStrLen,
Function
)
mEndDeclFunClass
141
mStartDeclFunClass
( SepStrSel,
Function
)
mEndDeclFunClass
142
143
mStartDeclFunClass
( Wildcard,
Function
)
mEndDeclFunClass
144
mStartDeclFunClass
( WildcardStr,
Function
)
mEndDeclFunClass
145
146
mStartDeclFunClass
( CurWindow,
Function
)
mEndDeclFunClass
147
148
};
// namespace CmdDrive
149
150
151
#endif
mExpClass
#define mExpClass(module)
Definition:
commondefs.h:160
uiMainWin
User interface main window.
Definition:
uimainwin.h:36
CmdDrive::Function::~Function
virtual ~Function()
Definition:
cmdfunction.h:39
CmdDrive::Function::Function
Function(const CmdDriver &cmddrv)
Definition:
cmdfunction.h:36
CmdDrive
Command Drive
Definition:
canvascommands.h:22
Stats::Sum
Definition:
stattype.h:27
Math::Ceil
float Ceil(float)
CmdDrive::WildcardManager
Definition:
searchkey.h:57
Math::Atan2
float Atan2(float y, float x)
File::Log
Definition:
file.h:99
BufferStringSet
Set of BufferString objects.
Definition:
bufstringset.h:28
Stats::Min
Definition:
stattype.h:26
Math::Abs
unsigned int Abs(unsigned int i)
Definition:
math2.h:80
mDefineFactory1ParamInClass
#define mDefineFactory1ParamInClass(T, P, funcname)
Definition:
factory.h:447
Math::Floor
float Floor(float)
Stats::Max
Definition:
stattype.h:26
mEndDeclFunClass
#define mEndDeclFunClass
Definition:
cmdfunction.h:91
CmdDrive::Function::drv_
const CmdDriver & drv_
Definition:
cmdfunction.h:50
factory.h
BufferString
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition:
bufstring.h:40
CmdDrive::Function
Definition:
cmdfunction.h:28
Math::Exp
float Exp(float)
Math::Sqrt
float Sqrt(float)
mStartDeclFunClass
#define mStartDeclFunClass(funkey, parentclass)
Definition:
cmdfunction.h:78
CmdDrive::CmdDriver
Definition:
cmddriver.h:103
bufstringset.h
Generated at for the
OpendTect
seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019