Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Examples  

qssegment.h

00001 /***************************************************************************
00002                                 QSSegment.h                              
00003                              -------------------                                         
00004     begin                : 01-January-2000
00005     copyright            : (C) 2000 by Kamil Dobkowski                         
00006     email                : kamildobk@poczta.onet.pl                                     
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   * 
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 
00019 #ifndef QSSEGMENT_H
00020 #define QSSEGMENT_H
00021 
00022 #include"qscoord.h"
00023 #include"qsgattr.h"
00024 #include"qsmatrix.h"
00025 
00026 class QSDrv;
00027 class QSCurve;
00028 class QSAxes;
00029 
00039 class QSSegment {
00040 
00041   public:
00045    QSSegment();
00049    virtual ~QSSegment();
00053    virtual int startDraw( const QSCurve * );
00057    virtual void initPass( int pass );
00061    virtual void drawSegment( int nr, const QSPt2f& point, const QSPt2f& delta, const QSGLine& l, const QSGFill& f, const QSGArrow& a1, const QSGArrow& a2 ) = 0;
00065    virtual void endPass() {}
00069    virtual void stopDraw() {}
00070 
00071   protected:
00072     QSDrv *m_drv;
00073     const QSCurve *m_parent;
00074   };
00075 
00076 //-------------------------------------------------------------//
00077 
00083 class QSSLines : public QSSegment  {
00084 
00085   public:
00086 
00087      QSSLines();
00088      virtual ~QSSLines();
00089      virtual int startDraw( const QSCurve *parent );
00090      virtual void initPass( int pass );
00091      virtual void drawSegment( int nr, const QSPt2f& point, const QSPt2f& delta, const QSGLine& l, const QSGFill& f, const QSGArrow& a1, const QSGArrow& a2 );
00092      virtual void endPass();
00093      virtual void stopDraw();
00094 
00095   private:
00096 
00097     QSGLine m_curr_line;
00098 };
00099 
00100 //-------------------------------------------------------------//
00101 
00106 class QSSPolys : public QSSegment  {
00107 
00108   public:
00109 
00110      enum Style { Area = 0, Ribbon = 1 };
00111 
00112      QSSPolys( Style style );
00113      virtual ~QSSPolys();
00114      virtual int startDraw( const QSCurve *parent );
00115      virtual void initPass( int pass );
00116      virtual void drawSegment( int nr, const QSPt2f& point, const QSPt2f& delta, const QSGLine& l, const QSGFill& f, const QSGArrow& a1, const QSGArrow& a2 );
00117      virtual void endPass();
00118      virtual void stopDraw();
00119 
00120   private:
00121     
00122     Style m_style;
00123     double m_zero_level;
00124     QSPt2f m_prev1;
00125     QSPt2f m_prev2;
00126     int m_pass;
00127     QSGLine m_curr_line;
00128     QSGFill m_curr_fill;
00129 };
00130 
00131 //-------------------------------------------------------------//
00132 
00137 class QSSBars : public QSSegment  {
00138 
00139   public:
00140     
00141      QSSBars();
00142      virtual ~QSSBars();
00143      virtual int startDraw( const QSCurve *parent );
00144      virtual void initPass( int pass );
00145      virtual void drawSegment( int nr, const QSPt2f& point, const QSPt2f& delta, const QSGLine& l, const QSGFill& f, const QSGArrow& a1, const QSGArrow& a2 );
00146      virtual void endPass();
00147      virtual void stopDraw();
00148 
00149   private:
00150 
00151     double m_zero_level;
00152     double m_prevx;
00153     QSPt2f m_prev;
00154     QSGLine m_curr_line;
00155     QSGFill m_curr_fill;
00156     void draw_bar( int nr, const QSPt2f& pos );
00157 };
00158 
00159 //-------------------------------------------------------------//
00160 
00165 class QSSFigures: public QSSegment  {
00166 
00167   public:
00168     
00169    enum Style { Vectors = 0, Rectangles = 1, Ellipses = 2, Flux = 3 };
00170 
00171    QSSFigures( Style style );
00172    virtual ~QSSFigures();
00173    virtual int startDraw( const QSCurve *parent );
00174    virtual void initPass( int pass );
00175    virtual void drawSegment( int nr, const QSPt2f& point, const QSPt2f& delta, const QSGLine& l, const QSGFill& f, const QSGArrow& a1, const QSGArrow& a2 );
00176    virtual void endPass();
00177    virtual void stopDraw();
00178 
00179   private:
00180     int m_style;
00181   };
00182 
00183 //-------------------------------------------------------------//
00184 
00189 class QSSStairs : public QSSegment  {
00190 
00191   public:
00192 
00193      enum Style { Left, Middle, Right };
00194 
00195      QSSStairs( Style style );
00196      virtual ~QSSStairs();
00197      virtual int startDraw( const QSCurve *parent );
00198      virtual void initPass( int pass );
00199      virtual void drawSegment( int nr, const QSPt2f& point, const QSPt2f& delta, const QSGLine& l, const QSGFill& f, const QSGArrow& a1, const QSGArrow& a2 );
00200      virtual void endPass();
00201      virtual void stopDraw();
00202 
00203   private:
00204     Style m_style;
00205     QSPt2f m_prev;
00206     QSPt2f m_prev_prev;
00207     QSGLine curr_line;
00208     void get_stair( const QSPt2f& pos, QSPt2f pos[3] );
00209 };
00210 
00211 #endif
00212 
00213 
00214 
00215 
00216 
00217 
00218 
00219 

Generated on Mon Mar 18 19:16:33 2002 for KMatplot library by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002