UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
zq_custom_scale.hpp
1 /* zq_custom_scale.hpp */
2 /* $Id$ */
3 #ifndef __zq_custom_scale_hpp
4 #define __zq_custom_scale_hpp
5 
6 #include <vector>
7 
8 #include <qpen.h>
9 
10 #include "zq_view.hpp"
11 #include "zq_scale.hpp"
12 #include "zd_coord_obj_stream.hpp"
13 
14 
22 class ZqCustomScale : public ZqScale
23 {
24 public:
25 
28  ZqCustomScale (ZqbNatGroup& rNatAxis, const char* szName = NULL);
29 
32  ZqCustomScale (ZqbNatGroup& rNatAxis,
33  ZqbPlaceholder* pPh, const char* szName = NULL);
34 
35 
36  /*
37  * Run-time type identification facility
38  */
39 
43  virtual bool compatibleDoc (const ZdDocument* pDoc) const;
44 
45 
46  /*
47  * Data control
48  */
49 
51  virtual void attachStream (ZdCoordObjStream* pStream);
52 
56  virtual void detachDoc ();
57 
59  virtual ZdCoordObjStream* stream ();
60 
62  void redefineCustomCoord(int coordId);
63 
66 
68  void setDefaultCustomCoord();
69 
70 
71  /*
72  * Properties - inherited from ZqScale
73  */
74 
75 
76  /*
77  * Polymorphic methods
78  */
79 
81  virtual void redraw (QPainter& paint);
82 
84  {
85  public:
86  DefCoordObjStream(const char* szDocName = NULL);
87 
88  virtual bool getCoordRange (double c[2]);
89 
90  virtual double averageCoordStep ();
91 
92  virtual int maxEnsembleLength ();
93 
94  virtual bool goFirstCoord ();
95 
96  virtual bool goNextCoord ();
97 
98  virtual double coord ();
99 
100  virtual int ensembleLength ();
101 
102  void* custom (int ens_index=0, ZqbType* pRetType=NULL);
103 
104  private:
105 
106  int m_coord;
107 
108  static int s_iNameCounter;
109  static const char *s_szOwnType;
110  };
111 
112 protected:
113 
114  virtual void adjustSizeLimits (QPainter& paint);
115 
118 
121 
124 
126  void draw_scale(QPainter& paint, ZdCoordObjStream *ipStream);
127 
129  virtual QString prepareLabel (ZdCoordObjStream *ipStream);
130 
131 private:
132 
134  static int s_iNameCounter;
135 
137  static DefCoordObjStream m_DefStream;
138 };
139 
140 
141 #endif /* zq_custom_scale.hpp */
virtual void attachStream(ZdCoordObjStream *pStream)
virtual QString prepareLabel(ZdCoordObjStream *ipStream)
ZdCoordObjStream * m_pStream
Definition: zq_custom_scale.hpp:117
int m_CustomCoordId
Definition: zq_custom_scale.hpp:123
virtual void adjustSizeLimits(QPainter &paint)
Definition: zqb_natgroup.hpp:35
Definition: zqb_placeholder.hpp:25
void draw_scale(QPainter &paint, ZdCoordObjStream *ipStream)
Definition: zd_coord_obj_stream.hpp:15
ZqCustomScale(ZqbNatGroup &rNatAxis, const char *szName=NULL)
Definition: zq_custom_scale.hpp:22
void redefineCustomCoord(int coordId)
virtual ZdCoordObjStream * stream()
Definition: zd_document.hpp:16
virtual void redraw()
Definition: zqb_visible.hpp:82
Definition: zq_custom_scale.hpp:83
void setDefaultCustomCoord()
void * custom(int ens_index=0, ZqbType *pRetType=NULL)
bool m_bDefaultCustomCoord
Definition: zq_custom_scale.hpp:120
virtual void detachDoc()
virtual bool compatibleDoc(const ZdDocument *pDoc) const
virtual bool getCoordRange(double c[2])
int getRedefinedCustomCoord()
Definition: zq_custom_scale.hpp:65
Definition: zq_scale.hpp:22