14 #include "msdevstudio/MSconfig.h"
25 #if QT_VERSION < 0x040000
28 #include <QtGui/QMouseEvent>
29 #include <QtGui/QPaintEvent>
37 using namespace hippodraw;
42 QWidget ( parent, name, wflags )
65 plotter -> addObserver (
this );
114 if ( display == 0 )
return;
122 double diff = ratio - w / h;
123 if ( diff > 0.00001 ) {
125 int new_w = static_cast <
int > ( w * ratio );
143 int ix = static_cast <
int > (
x );
144 int iy = static_cast <
int > (
y );
145 int iw = static_cast <
int > ( w );
146 int ih = static_cast <
int > ( h );
192 std::vector < double > & picked )
const
197 m_plotter -> fillPickedPointFrom ( xx, yy, picked );
202 return static_cast <
int > ( dx );
207 return static_cast <
int > ( dy );
212 #if QT_VERSION < 0x040000
215 transformAndFill ( QPolygon & array,
217 const std::vector< double > & x,
218 const std::vector< double > & y,
223 unsigned int size = x.size();
224 assert ( size == y.size() );
226 for (
unsigned int i = 0; i <
size; i++ ) {
227 int ix = (this->*xfunc) ( x[i] );
228 int iy = (this->*yfunc) ( y[i] );
229 array.setPoint ( i , ix, iy );
239 const std::vector< double > & y,
243 unsigned int size = x.size();
244 assert ( size == y.size() );
246 #if QT_VERSION < 0x040000
249 QPolygon array ( size );
262 const std::vector < double > & y,
267 unsigned int size = x.size();
268 assert ( size == y.size() );
270 #if QT_VERSION < 0x040000
273 QPolygon array ( size );
292 if ( e -> state () == Qt::ControlButton ) {