Qwt User's Guide
qwt_point_mapper.h
00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
00002  * Qwt Widget Library
00003  * Copyright (C) 1997   Josef Wilgen
00004  * Copyright (C) 2002   Uwe Rathmann
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the Qwt License, Version 1.0
00008  *****************************************************************************/
00009 
00010 #ifndef QWT_POINT_MAPPER_H
00011 #define QWT_POINT_MAPPER_H
00012 
00013 #include "qwt_global.h"
00014 #include "qwt_series_data.h"
00015 #include <qimage.h>
00016 
00017 class QwtScaleMap;
00018 class QPolygonF;
00019 class QPolygon;
00020 
00029 class QWT_EXPORT QwtPointMapper
00030 {
00031 public:
00036     enum TransformationFlag
00037     {
00039         RoundPoints = 0x01,
00040 
00045         WeedOutPoints = 0x02
00046     };
00047 
00052     typedef QFlags<TransformationFlag> TransformationFlags;
00053 
00054     QwtPointMapper();
00055     ~QwtPointMapper();
00056 
00057     void setFlags( TransformationFlags );
00058     TransformationFlags flags() const;
00059 
00060     void setFlag( TransformationFlag, bool on = true );
00061     bool testFlag( TransformationFlag ) const;
00062 
00063     void setBoundingRect( const QRectF & );
00064     QRectF boundingRect() const;
00065 
00066     QPolygonF toPolygonF( const QwtScaleMap &xMap, const QwtScaleMap &yMap,
00067         const QwtSeriesData<QPointF> *series, int from, int to ) const;
00068 
00069     QPolygon toPolygon( const QwtScaleMap &xMap, const QwtScaleMap &yMap,
00070         const QwtSeriesData<QPointF> *series, int from, int to ) const;
00071 
00072     QPolygon toPoints( const QwtScaleMap &xMap, const QwtScaleMap &yMap,
00073         const QwtSeriesData<QPointF> *series, int from, int to ) const;
00074 
00075     QPolygonF toPointsF( const QwtScaleMap &xMap, const QwtScaleMap &yMap,
00076         const QwtSeriesData<QPointF> *series, int from, int to ) const;
00077 
00078     QImage toImage( const QwtScaleMap &xMap, const QwtScaleMap &yMap,
00079         const QwtSeriesData<QPointF> *series, int from, int to, 
00080         const QPen &, bool antialiased, uint numThreads ) const;
00081 
00082 private:
00083     class PrivateData;
00084     PrivateData *d_data;
00085 };
00086 
00087 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPointMapper::TransformationFlags )
00088 
00089 #endif
 All Classes Functions Variables Typedefs Enumerations Enumerator