UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
zd_function.hpp
1 /* zd_function.hpp */
2 /* $Id: zd_function.hpp,v 1.8 2007/04/14 00:33:33 vlad Exp $ */
3 #ifndef __zd_function_hpp
4 #define __zd_function_hpp
5 
6 #include "zd_document.hpp"
7 
8 
10 typedef enum
11 {
12  Z_F_ARG_HOR,
13  Z_F_ARG_VER
15 } ZdFuncArgDir;
16 
17 
27 class ZdFunction : public ZdDocument
28 {
29 public:
30 
33  ZdFunction (const char* szFuncName = NULL);
34 
36  virtual ~ZdFunction ();
37 
38 
39  /*
40  * Run-time type identification facility
41  */
42 
44  virtual bool compatibleType (const char* szType) const;
45 
46 
47  /*
48  * Basic functionality
49  */
50 
52  virtual int count () = 0;
53 
55  virtual double arg (int i) = 0;
56 
59  virtual double func (int i) = 0;
60 
61 
62  /*
63  * Extended functionality with default implementation
64  */
65 
67  virtual void arg (std::vector<double>& vArg);
68 
72  virtual void func (std::vector<double>& vFunc,
73  double fNull = 0.0);
74 
77  virtual bool isNullAll ();
78 
81  virtual bool isNullFunc (int i);
82 
85  virtual double argStep ();
86 
90  virtual void getArgBounds (double b[2]);
91 
93  virtual double minArg () {
94  double b[2];
95  getArgBounds(b);
96  return b[0];
97  }
98 
100  virtual double maxArg () {
101  double b[2];
102  getArgBounds(b);
103  return b[1];
104  }
105 
110  virtual void getFuncBounds (double b[2]);
111 
113  double minFunc () {
114  double b[2];
115  getFuncBounds(b);
116  return b[0];
117  }
118 
120  virtual double maxFunc () {
121  double b[2];
122  getFuncBounds(b);
123  return b[1];
124  }
125 
129  virtual int argIndex (double a);
130 
136  virtual double funcInterp (double a);
137 
138  /*
139  * Additional functionality, not implemented at all by default
140  */
141 
143  virtual void setFunc (int i, double fNewValue);
144 
147  virtual void makeNullFunc (int i);
148 
150  virtual void makeNullAll ();
151 
152 private:
153 
155  static int s_iNameCounter;
156 
158  static char *s_szOwnType;
159 
160 };
161 
162 
163 #endif /* zd_function.hpp */
virtual double maxFunc()
Definition: zd_function.hpp:120
virtual double argStep()
virtual double arg(int i)=0
virtual bool isNullFunc(int i)
ZdFunction(const char *szFuncName=NULL)
virtual int argIndex(double a)
virtual void getArgBounds(double b[2])
virtual double maxArg()
Definition: zd_function.hpp:100
virtual double func(int i)=0
virtual void makeNullFunc(int i)
virtual bool isNullAll()
Definition: zd_function.hpp:27
virtual void getFuncBounds(double b[2])
Definition: zd_document.hpp:16
virtual double funcInterp(double a)
virtual void makeNullAll()
virtual void setFunc(int i, double fNewValue)
virtual double minArg()
Definition: zd_function.hpp:93
virtual ~ZdFunction()
double minFunc()
Definition: zd_function.hpp:113
virtual int count()=0
virtual bool compatibleType(const char *szType) const