UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
zq_curve.hpp
1 /* zq_curve.hpp */
2 /* $Id: zq_curve.hpp,v 1.5 2008/04/24 11:29:54 vlad Exp $ */
3 #ifndef __zq_curve_hpp
4 #define __zq_curve_hpp
5 
6 #include <vector>
7 
8 #include <qpen.h>
9 #include <qpointarray.h>
10 
11 #include "zq_view.hpp"
12 #include "zqb_natgroup.hpp"
13 #include "zd_function.hpp"
14 #include "zd_real_func.hpp"
15 
16 
29 class ZqCurve : public ZqView
30 {
31 public:
32 
35  BarGraph = -1,
36  StepCurve = 0,
39  };
40 
43  ZqCurve (ZqbNatGroup& rNatArg, ZqbNatGroup& rNatFunc,
44  const char* szName = NULL);
45 
48  ZqCurve (ZqbNatGroup& rNatArg, ZqbNatGroup& rNatFunc,
49  ZqbPlaceholder* pPh, const char* szName = NULL);
50 
51 
54 
57 
58 
59  /*
60  * Run-time type identification facility
61  */
62 
66  virtual bool compatibleDoc (const ZdDocument* pDoc) const;
67 
68 
69  /*
70  * Data access
71  */
72 
76  virtual void attachData (ZdFunction* pData,
77  ZdFuncArgDir eArgDir);
78 
81  virtual void detachDoc ();
82 
85  virtual ZdFunction* data ();
86 
89  virtual ZdFuncArgDir argDir () const;
90 
92  virtual double x (int i);
93 
95  virtual double y (int i);
96 
99  virtual void xMinMax (double mm[2]);
100 
103  virtual void yMinMax (double mm[2]);
104 
105 
106  /*
107  * Properties
108  */
109 
111  virtual void setPen (const QPen& pen);
112 
114  virtual const QPen& getPen () const;
115 
117  virtual QPen& pen ();
118 
119 
124  virtual void setInterpolation (int interp);
125 
127  virtual int getInterpolation () const;
128 
129 
131  virtual void setAutoSort (bool bSortFlag);
132 
134  virtual bool getAutoSort () const;
135 
136 
139  virtual void setBaseLevel (double fBase);
140 
142  virtual double getBaseLevel () const;
143 
144 
147  virtual void setBarSpace (double fArgDelta);
148 
150  virtual double getBarSpace () const;
151 
152 
153  /*
154  * Polymorphic methods
155  */
156 
158  virtual void redraw (QPainter& paint);
159 
160 protected:
161 
164  void addSegment (double x[2], double y[2],
165  double rx[2], double ry[2]);
166 
168  void addPoint (double x, double y,
169  double rx[2], double ry[2]);
170 
173  void addBar (double x[2], double y[2],
174  double rx[2], double ry[2]);
175 
177  QPen m_qPen;
178 
185 
190 
192  ZdFuncArgDir m_eArgDir;
193 
198  QPointArray m_Nodes;
199 
203  std::vector<bool> m_Linked;
204 
207 
210 
216 
217 private:
218 
220  static int s_iNameCounter;
221 
222 };
223 
224 
225 #include "zq_curve_inline.hpp"
226 
227 
228 #endif /* zq_curve.hpp */
virtual void attachData(ZdFunction *pData, ZdFuncArgDir eArgDir)
void addPoint(double x, double y, double rx[2], double ry[2])
virtual void yMinMax(double mm[2])
Definition: zq_curve_inline.hpp:227
virtual const QPen & getPen() const
Definition: zq_curve_inline.hpp:49
virtual double getBarSpace() const
Definition: zq_curve_inline.hpp:286
virtual ZdFuncArgDir argDir() const
Definition: zq_curve_inline.hpp:148
QPointArray m_Nodes
Definition: zq_curve.hpp:198
double m_fBaseFuncLevel
Definition: zq_curve.hpp:209
std::vector< bool > m_Linked
Definition: zq_curve.hpp:203
Definition: zqb_natgroup.hpp:35
virtual void setBarSpace(double fArgDelta)
Definition: zq_curve_inline.hpp:275
Definition: zqb_placeholder.hpp:25
ZqCurve(ZqbNatGroup &rNatArg, ZqbNatGroup &rNatFunc, const char *szName=NULL)
ZdRealFunc * m_zdFuncSorted
Definition: zq_curve.hpp:206
virtual double x(int i)
Definition: zq_curve_inline.hpp:159
void addSegment(double x[2], double y[2], double rx[2], double ry[2])
virtual void setInterpolation(int interp)
Definition: zq_curve_inline.hpp:74
virtual int getInterpolation() const
Definition: zq_curve_inline.hpp:90
void addBar(double x[2], double y[2], double rx[2], double ry[2])
Definition: zd_function.hpp:27
Definition: zq_view.hpp:18
Definition: zq_curve.hpp:29
virtual ZdFunction * data()
Definition: zq_curve_inline.hpp:134
Interpolation
Definition: zq_curve.hpp:34
virtual void setBaseLevel(double fBase)
Definition: zq_curve_inline.hpp:252
double m_fSpaceBetweenBars
Definition: zq_curve.hpp:215
Definition: zd_document.hpp:16
virtual void redraw()
Definition: zqb_visible.hpp:82
virtual double getBaseLevel() const
Definition: zq_curve_inline.hpp:263
virtual bool compatibleDoc(const ZdDocument *pDoc) const
Definition: zq_curve_inline.hpp:23
virtual bool getAutoSort() const
Definition: zq_curve_inline.hpp:117
Definition: zd_real_func.hpp:21
virtual void setAutoSort(bool bSortFlag)
Definition: zq_curve_inline.hpp:101
bool m_bAutoSort
Definition: zq_curve.hpp:189
virtual double y(int i)
Definition: zq_curve_inline.hpp:180
QPen m_qPen
Definition: zq_curve.hpp:177
virtual void xMinMax(double mm[2])
Definition: zq_curve_inline.hpp:202
virtual void setPen(const QPen &pen)
Definition: zq_curve_inline.hpp:38
ZqbNatGrpMember m_Arg
Definition: zq_curve.hpp:53
ZdFuncArgDir m_eArgDir
Definition: zq_curve.hpp:192
ZqbNatGrpMember m_Func
Definition: zq_curve.hpp:56
Definition: zq_curve.hpp:37
int m_iInterpolation
Definition: zq_curve.hpp:184
virtual QPen & pen()
Definition: zq_curve_inline.hpp:60
Definition: zq_curve.hpp:36
Definition: zqb_natgrpmember.hpp:26
virtual void detachDoc()
Definition: zq_curve.hpp:35