UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
zq_coord_marker.hpp
1 /* zq_coord_marker.hpp */
2 /* $Id: zq_coord_marker.hpp 20080 2009-12-15 15:57:52Z vlad $ */
3 #ifndef __zq_coord_marker_hpp
4 #define __zq_coord_marker_hpp
5 
6 #include <vector>
7 
8 #include "zq_view.hpp"
9 #include "zqb_natgroup.hpp"
10 #include "zqb_natgrpmember.hpp"
11 #include "zd_coord_obj_stream.hpp"
12 
13 
20 class ZqCoordMarker : public ZqView, public ZqbNatGrpMember
21 {
22 public:
23 
26  struct Mark {
27  double m_fCoord;
28  int m_iMark;
29  Mark () : m_fCoord(0.0), m_iMark(0) {}
30  bool operator< (const Mark& m) const {
31  return m_fCoord < m.m_fCoord;
32  };
33  bool operator== (const Mark& m) const {
34  return m_fCoord == m.m_fCoord;
35  };
36  };
37 
39  typedef std::vector<Mark> Marks;
40 
41 public:
42 
45  ZqCoordMarker (ZqbNatGroup& rGroup, const char* szName = NULL);
46 
51  const char* szName = NULL);
52 
53 
55  virtual ~ZqCoordMarker ();
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 setOrientation (Qt::Orientation eOrient);
74 
76  virtual Qt::Orientation getOrientation () const;
77 
78 
79  /*
80  * Run-time type identification facility
81  */
82 
85  virtual bool compatibleDoc (const ZdDocument* pDoc) const;
86 
87  /*
88  * Data control
89  */
90 
96  virtual void attachCOStream (ZdCoordObjStream* pCOStream);
97 
100  virtual void detachDoc ();
101 
103  virtual ZdCoordObjStream* coStream ();
104 
105 
106  /*
107  * To implement in derived classes
108  */
109 
111  virtual void redraw (QPainter& paint);
112 
114  virtual ZqbEventHint input (QEvent& event);
115 
116 
122  virtual bool markEvent (const QEvent& event, QPoint& pos);
123 
124  /*
125  * Marks drawing/accessing tools
126  */
127 
132  virtual void drawMarkAt (QPainter& paint,
133  double coord, int mark);
134 
140  virtual int changeMark (double coord, int mark);
141 
144  virtual void setMark (double coord, int mark,
145  double* pMatched = NULL);
146 
149  virtual int getMark (double coord,
150  double* pMatched = NULL) const;
151 
153  virtual void getMarks (Marks& vMarks) const;
154 
155 
156 protected:
157 
159  QPen m_qPen;
160 
163  Qt::Orientation m_eOrient;
164 
167  Marks m_vMarks;
168 
169 private:
170 
172  static int s_iNameCounter;
173 
174 };
175 
176 
177 #include "zq_coord_marker_inline.hpp"
178 
179 
180 #endif /* zq_coord_marker.hpp */
virtual void drawMarkAt(QPainter &paint, double coord, int mark)
virtual ~ZqCoordMarker()
virtual void getMarks(Marks &vMarks) const
ZqCoordMarker(ZqbNatGroup &rGroup, const char *szName=NULL)
Definition: zqb_natgroup.hpp:35
Definition: zqb_placeholder.hpp:25
virtual void setPen(const QPen &pen)
Definition: zq_coord_marker_inline.hpp:23
virtual void setOrientation(Qt::Orientation eOrient)
Definition: zq_coord_marker_inline.hpp:56
Definition: zd_coord_obj_stream.hpp:15
Definition: zq_view.hpp:18
virtual void detachDoc()
virtual void setMark(double coord, int mark, double *pMatched=NULL)
virtual int changeMark(double coord, int mark)
virtual bool compatibleDoc(const ZdDocument *pDoc) const
Definition: zd_document.hpp:16
virtual void redraw()
Definition: zqb_visible.hpp:82
std::vector< Mark > Marks
Definition: zq_coord_marker.hpp:39
QPen m_qPen
Definition: zq_coord_marker.hpp:159
virtual bool markEvent(const QEvent &event, QPoint &pos)
Marks m_vMarks
Definition: zq_coord_marker.hpp:167
virtual ZdCoordObjStream * coStream()
virtual const QPen & getPen() const
Definition: zq_coord_marker_inline.hpp:34
Definition: zq_coord_marker.hpp:20
Qt::Orientation m_eOrient
Definition: zq_coord_marker.hpp:163
virtual ZqbEventHint input(QEvent &event)
virtual Qt::Orientation getOrientation() const
Definition: zq_coord_marker_inline.hpp:67
Definition: zqb_natgrpmember.hpp:26
virtual int getMark(double coord, double *pMatched=NULL) const
virtual QPen & pen()
Definition: zq_coord_marker_inline.hpp:45
virtual void attachCOStream(ZdCoordObjStream *pCOStream)