UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
zq_scale.hpp
1 /* zq_scale.hpp */
2 /* $Id: zq_scale.hpp 20080 2009-12-15 15:57:52Z vlad $ */
3 #ifndef __zq_scale_hpp
4 #define __zq_scale_hpp
5 
6 #include <vector>
7 
8 #include <qpen.h>
9 
10 #include "zq_view.hpp"
11 #include "zqb_natgroup.hpp"
12 #include "zd_function.hpp"
13 
14 
22 class ZqScale : public ZqView, public ZqbNatGrpMember
23 {
24 public:
25 
28  enum Placement {
29  Undefined,
30  TopSide,
31  BottomSide,
32  LeftSide,
34  RightSide
36  };
37 
39  enum AxisDecor {
40  Standard = 0x0000,
42  NoSubticks = 0x0001,
43  NoTicks = 0x0002,
44  NoLabels = 0x0004
46  };
47 
50  ZqScale (ZqbNatGroup& rNatAxis, const char* szName = NULL);
51 
54  ZqScale (ZqbNatGroup& rNatAxis,
55  ZqbPlaceholder* pPh, const char* szName = NULL);
56 
57 
58  /*
59  * Properties
60  */
61 
63  virtual void setPen (const QPen& pen);
64 
66  virtual const QPen& getPen () const;
67 
69  virtual QPen& pen ();
70 
71 
73  virtual void setFont (const QFont& font);
74 
76  virtual const QFont& getFont () const;
77 
79  virtual QFont& font ();
80 
81 
84  virtual void setPlacement (Placement ePlacement);
85 
87  virtual Placement getPlacement () const;
88 
89 
93  virtual void setIntegerTicks (bool bFlag);
94 
96  virtual bool isIntegerTicks () const;
97 
98 
100  virtual void setAxisDecor (int mMode);
101 
103  virtual int getAxisDecor () const;
104 
105 
106  /*
107  * Polymorphic methods
108  */
109 
111  virtual void redraw (QPainter& paint);
112 
114  virtual void updateLimits (QPainter* paint = NULL);
115 
116  /*
117  * Coordinates change processing
118  */
119 
122  virtual void onSetCoords ();
123 
124 
125  /*
126  * Drawing internals
127  */
128 
132  virtual QString prepareLabel (double fCoord);
133 
135  virtual void prepareTicks (ZqbNatGroup::Ticks& ticks);
136 
138  virtual bool insideRect (QPoint p);
139 
140  bool isRect (QPoint p) {
141  return insideRect(p);
142  }
143 
144 
149  virtual bool compatibleDoc (const ZdDocument* pDoc) const;
150 
153  static int s_iMainTickSize, s_iSecTickSize,
154  s_iLabelOffset, s_iBetweenLabels;
155 
156 protected:
157 
160  virtual void adjustSizeLimits (QPainter& paint);
161 
163  QPen m_qPen;
164 
166  QFont m_qFont;
167 
171 
174  bool m_bIntegerLabels;
175 
178  int m_mAxisDecor;
179 
180 private:
181 
183  static int s_iNameCounter;
184 
185 };
186 
187 
188 #include "zq_scale_inline.hpp"
189 
190 
191 #endif /* zq_scale.hpp */
Definition: zq_scale.hpp:42
Placement
Definition: zq_scale.hpp:28
virtual void onSetCoords()
Definition: zq_scale.hpp:29
virtual void prepareTicks(ZqbNatGroup::Ticks &ticks)
virtual bool compatibleDoc(const ZdDocument *pDoc) const
virtual const QFont & getFont() const
Definition: zq_scale_inline.hpp:66
Definition: zq_scale.hpp:32
Placement m_ePlacement
Definition: zq_scale.hpp:163
Definition: zq_scale.hpp:34
Definition: zqb_natgroup.hpp:35
Definition: zqb_placeholder.hpp:25
QPen m_qPen
Definition: zq_scale.hpp:156
Definition: zq_scale.hpp:40
virtual void setAxisDecor(int mMode)
Definition: zq_scale_inline.hpp:133
Definition: zq_scale.hpp:30
ZqScale(ZqbNatGroup &rNatAxis, const char *szName=NULL)
virtual QPen & pen()
Definition: zq_scale_inline.hpp:44
Definition: zq_view.hpp:18
virtual void updateLimits(QPainter *paint=NULL)
virtual bool isIntegerTicks() const
Definition: zq_scale_inline.hpp:122
virtual bool insideRect(QPoint p)
Definition: zq_scale.hpp:31
Definition: zq_scale.hpp:44
AxisDecor
Definition: zq_scale.hpp:39
Definition: zd_document.hpp:16
virtual void redraw()
Definition: zqb_visible.hpp:82
int m_mAxisDecor
Definition: zq_scale.hpp:171
virtual void setIntegerTicks(bool bFlag)
Definition: zq_scale_inline.hpp:111
void adjustSizeLimits(QPainter &paint)
virtual int getAxisDecor() const
Definition: zq_scale_inline.hpp:144
virtual const QPen & getPen() const
Definition: zq_scale_inline.hpp:33
std::vector< Tick > Ticks
Definition: zqb_natgroup.hpp:214
virtual QFont & font()
Definition: zq_scale_inline.hpp:77
QFont m_qFont
Definition: zq_scale.hpp:159
bool m_bIntegerLabels
Definition: zq_scale.hpp:167
static int s_iMainTickSize
Definition: zq_scale.hpp:146
virtual void setPlacement(Placement ePlacement)
Definition: zq_scale_inline.hpp:88
virtual void setPen(const QPen &pen)
Definition: zq_scale_inline.hpp:22
virtual QString prepareLabel(double fCoord)
virtual Placement getPlacement() const
Definition: zq_scale_inline.hpp:99
virtual void setFont(const QFont &font)
Definition: zq_scale_inline.hpp:55
Definition: zqb_natgrpmember.hpp:26
Definition: zq_scale.hpp:43
Definition: zq_scale.hpp:22