QtView.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef _QtView_H_
15 #define _QtView_H_
16 
17 #include "QtViewImp.h"
18 
19 #if QT_VERSION < 0x040000
20 #include <qcanvas.h>
21 #else
22 #include <q3canvas.h>
23 #endif
24 
25 #include <qpixmap.h>
26 
27 namespace hippodraw {
28 
40 #if QT_VERSION < 0x040000
42 #else
43 class MDL_QTHIPPOPLOT_API QtView : public QtViewImp, public Q3CanvasRectangle
44 #endif
45 
46 {
47 private:
48 
52 
54  int m_upage_w;
55 
58  bool m_filled;
59 
63 
67 
68 
70  int toCanvasX ( double dx ) const;
71 
73  int toCanvasY ( double dy ) const;
74 
81 #if QT_VERSION < 0x040000
82  void transformAndFill ( QPointArray & array,
83 #else
84  void transformAndFill ( QPolygon & array,
85 #endif
86  const std::vector < double > & x,
87  const std::vector < double > & y,
88  int (QtView::* xfunc ) ( double ) const,
89  int (QtView::* yfunc ) ( double ) const );
90 
97  void drawWithPixmap ( QPainter & painter );
100  void drawMethod ( const std::vector< double > & x,
101  const std::vector< double > & y,
102  int opt1,
103  int opt2 );
104 
111  void drawViewMethod ( const std::vector< double > & x,
112  const std::vector< double > & y,
113  int opt1,
114  int opt2 );
115 
121  void ensureOffScrSize ( int osw, int osh );
122 
123 public:
124 
128  QtView ( PlotterBase * plotter );
129 
131  QtView ( const QtView & );
132 
134  virtual ~QtView ();
135 
140  virtual void draw ( QPainter & );
141 
143  virtual void drawShape ( QPainter & );
144 
149  virtual void update ( const Observable * );
150 
157  virtual void setShowCrossHairs ( bool flag );
158 
161  virtual Rect getDrawRect () const;
162 
163 
167  void updateDrawRect ();
168 
170  void setDrawRect ( const QRect & rect );
171 
173  void setDrawRect ( Rect & rect );
174 
176  virtual void setDrawRect ( float x, float y, float width, float height );
177 
179  int toViewX ( double datX ) const;
180 
182  int toViewY ( double datY ) const;
183 
184 
185  virtual void fillPickedPoint ( double x, double y,
186  std::vector < double > & picked ) const;
187 
190  virtual void setPageWidth( int upage_w );
191 
192  /* Test if the plotter of this view is a text plotter */
193  bool isTextView() const;
194 };
195 
196 } // namespace hippodraw
197 
198 #endif // _QtView_H_

Generated for HippoDraw Class Library by doxygen