QtViewWidget.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef _QtViewWidget_H_
15 #define _QtViewWidget_H_
16 
17 #include "QtViewImp.h"
18 
19 #include <qpixmap.h>
20 #include <qwidget.h>
21 
22 class QPaintEvent;
23 
24 namespace hippodraw {
25 
38 {
40  QtViewWidget ( const QtViewWidget & );
41 
43  int toCanvasX ( double dx ) const;
44 
46  int toCanvasY ( double dy ) const;
47 
54 #if QT_VERSION < 0x040000
55  void transformAndFill ( QPointArray & array,
56 #else
57  void transformAndFill ( QPolygon & array,
58 #endif
59  const std::vector < double > & x,
60  const std::vector < double > & y,
61  int (QtViewWidget::* xfunc ) ( double ) const,
62  int (QtViewWidget::* yfunc ) ( double ) const );
63 
66  void drawMethod ( const std::vector< double > & x,
67  const std::vector< double > & y,
68  int opt1,
69  int opt2 );
70 
77  void drawViewMethod ( const std::vector< double > & x,
78  const std::vector< double > & y,
79  int opt1,
80  int opt2 );
81 
84 
85 public:
86 
89  QtViewWidget ( QWidget * parent = 0,
90  const char * name = 0,
91  Qt::WFlags wflags = 0 );
92 
94  virtual ~QtViewWidget ();
95 
102  void setPlotter ( PlotterBase * );
103 
105  virtual QSize sizeHint () const;
106 
109  virtual void draw ( QPainter & );
110 
112  virtual void paintEvent ( QPaintEvent * );
113 
114  virtual void update ( const Observable * );
115 
119  virtual void setGeometry ( int x, int y, int w, int h );
120 
124  virtual void setGeometry ( const QRect & );
125 
126  virtual Rect getDrawRect () const;
127 
129  void setDrawRect ( const QRect & rect );
130 
132  virtual void setDrawRect ( float x, float y, float width, float height );
133 
136  virtual void resizeEvent ( QResizeEvent * event );
137 
139  int toViewX ( double datX ) const;
140 
142  int toViewY ( double datY ) const;
143 
144  virtual void fillPickedPoint ( double x, double y,
145  std::vector < double > & picked ) const;
146 
147  virtual void setDoubleBuffering( unsigned dblbuf);
148 
153  virtual void mousePressEvent ( QMouseEvent * e );
154 
155 };
156 
157 } // namespace hippodraw
158 
159 #endif // _QtViewWidget_H_

Generated for HippoDraw Class Library by doxygen