UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
zq_polygon.hpp
1 /* zq_polygon.hpp */
2 /* $Id: zq_polygon.hpp 20080 2009-12-15 15:57:52Z vlad $ */
3 #ifndef __zq_polygon_hpp
4 #define __zq_polygon_hpp
5 
6 #include <utility>
7 #include <vector>
8 
9 #include "zqb_natgroup.hpp"
10 #include "zq_object.hpp"
11 
12 
14 typedef std::vector<std::pair<double,double> > ZqbNatPoints;
15 
16 
24 class ZqPolygon : public ZqObject
25 {
26 public:
27 
31  ZqPolygon (ZqbNatGroup& rNatX, ZqbNatGroup& rNatY,
32  const char* szName = NULL);
33 
35  ZqPolygon (ZqbNatGroup& rNatX, ZqbNatGroup& rNatY,
36  ZqbPlaceholder* pPh, const char* szName = NULL);
37 
38 
41 
44 
45 
46  /*
47  * Properties
48  */
49 
51  virtual void setThickness (int iThickness);
52 
54  virtual int getThickness () const;
55 
56 
58  virtual void setLineColor (const QColor& qcLine);
59 
61  virtual const QColor& getLineColor () const;
62 
63 
64  /*
65  * Events processing
66  */
67 
75  virtual ZqbEventHint input (QEvent& event);
76 
78  virtual void polygon (const ZqbNatPoints& vPolygon);
79 
80 
83  virtual void redraw (QPainter& paint);
84 
85 
86 protected:
87 
89  void drawPolyline (QPainter &paint, const QPolygon &ar);
90 
92  void drawLine (QPainter &paint, const QPoint& p1, const QPoint& p2);
93 
95  void erasePolyline ();
96 
98  void eraseLastSegment ();
99 
102  QPolygon m_arPoints;
103 
107  bool m_bDrawnPolyline;
108 
111  QPoint m_qLast;
112 
115  bool m_bDrawnLast;
116 
118  int m_iThickness;
119 
121  QColor m_qcLine;
122 
123 private:
124 
126  static int s_iNameCounter;
127 
128 };
129 
130 
131 #include "zq_polygon_inline.hpp"
132 
133 
134 #endif /* zq_polygon.hpp */
bool m_bDrawnLast
Definition: zq_polygon.hpp:115
virtual const QColor & getLineColor() const
Definition: zq_polygon_inline.hpp:55
bool m_bDrawnPolyline
Definition: zq_polygon.hpp:107
QPoint m_qLast
Definition: zq_polygon.hpp:111
virtual void setThickness(int iThickness)
Definition: zq_polygon_inline.hpp:22
virtual void setLineColor(const QColor &qcLine)
Definition: zq_polygon_inline.hpp:44
virtual void polygon(const ZqbNatPoints &vPolygon)
virtual ZqbEventHint input(QEvent &event)
virtual int getThickness() const
Definition: zq_polygon_inline.hpp:33
Definition: zqb_natgroup.hpp:35
Definition: zqb_placeholder.hpp:25
int m_iThickness
Definition: zq_polygon.hpp:118
QPolygon m_arPoints
Definition: zq_polygon.hpp:102
virtual void redraw()
Definition: zqb_visible.hpp:82
ZqbNatGrpMember m_NatY
Definition: zq_polygon.hpp:43
void drawLine(const QPoint &p1, const QPoint &p2)
ZqbNatGrpMember m_NatX
Definition: zq_polygon.hpp:40
Definition: zq_object.hpp:36
Definition: zq_polygon.hpp:24
Definition: zqb_natgrpmember.hpp:26
QColor m_qcLine
Definition: zq_polygon.hpp:121
void eraseLastSegment()
Definition: zq_polygon_inline.hpp:85
void drawPolyline(const QPointArray &ar)
void erasePolyline()
Definition: zq_polygon_inline.hpp:72
ZqPolygon(ZqbNatGroup &rNatX, ZqbNatGroup &rNatY, const char *szName=NULL)