00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef QSAXES2D_H
00020 #define QSAXES2D_H
00021
00022 #ifdef HAVE_CONFIG_H
00023 #include <config.h>
00024 #endif
00025
00026 #include"qsaxes.h"
00027 #include"qsprojection2d.h"
00028
00034 class QSAxes2D : public QSAxes
00035 {
00036 Q_OBJECT
00037 Q_PROPERTY( int frameWidth READ frameWidth WRITE setFrameWidth )
00038
00039 public:
00043 QSAxes2D(QObject* parent=0, const char * name=0);
00047 ~QSAxes2D();
00051 virtual void stop();
00055 void setFrameWidth( int width );
00059 int frameWidth() const { return m_framew; }
00063 virtual void initMappings( QSDrv *drv );
00067 virtual QSPt3f mixedToCanvas( const QSPt3f& pos, CoordinateSystem in_coords[3], double dpi, QSAxis *xAxis, QSAxis *yAxis, QSAxis *zAxis ) const ;
00071 virtual QSPt3f canvasToMixed( const QSPt3f& pos, CoordinateSystem out_coords[3], double dpi, QSAxis *xAxis, QSAxis *yAxis, QSAxis *zAxis ) const ;
00075 virtual void paintPlot( QPainter *p, double dpi=72.0, bool blocking=true, bool transparent=true );
00079 virtual void drawPlot( QSDrv *drv, bool blocking=true, bool transparent=true );
00083 virtual QString posInfo( QSPt2f& pos );
00087 enum FillElement {
00088 RectFill = 0,
00089 FrameFill
00090 };
00091
00092 virtual void loadStateFromStream( QDataStream& stream, QSObjectFactory *factory );
00093 virtual void saveStateToStream( QDataStream& stream, QSObjectFactory *factory );
00094
00095 protected:
00099 void axisRangesCalculated();
00103 void allocRuntimeData();
00107 void freeRuntimeData();
00111 virtual void drawAxis( QSAxis *axis );
00115 virtual void drawGrid( QSAxis *axis, bool major );
00116
00117 private:
00118 QSProjection2D t;
00119 int m_framew;
00120 bool m_is_graphics_active;
00121 struct axes2d_runtime_data;
00122 struct axes2d_runtime_data *d;
00123 void default_settings();
00124 void init_2dtr();
00125 void draw_axes();
00126 void draw_rect( const QSPt2f& p1, const QSPt2f& p2 );
00127 double ticlen( int axis, bool major );
00128
00129 };
00130
00136 #endif
00137