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

qssurface.h

00001 /***************************************************************************
00002                                  qssurface.h
00003                              -------------------
00004     begin                : 01-January-2000
00005 
00006     copyright            : (C) 2000 by Kamil Dobkowski
00007     email                : kamildobk@poczta.onet.pl
00008  ***************************************************************************/
00009 
00010 /***************************************************************************
00011  *                                                                         *
00012  *   This program is free software; you can redistribute it and/or modify  *
00013  *   it under the terms of the GNU General Public License as published by  *
00014  *   the Free Software Foundation; either version 2 of the License, or     *
00015  *   (at your option) any later version.                                   *
00016  *                                                                         *
00017  ***************************************************************************/
00018 
00019 #ifndef __QSSURFACE_H
00020 #define __QSSURFACE_H
00021 
00022 #ifdef HAVE_CONFIG_H
00023 #include <config.h>
00024 #endif
00025 
00026 #include"qsplot.h"
00027 #include"qsaxes.h"
00028 
00029 
00030 
00036 class QSSurface : public QSPlot3D
00037    {
00038     Q_OBJECT
00039     Q_PROPERTY( int xGridStep READ xGridStep WRITE setXGridStep )
00040     Q_PROPERTY( int yGridStep READ yGridStep WRITE setYGridStep )
00041     
00042     public:
00048         enum Channels   {
00049               XVector=0,
00050                           YVector=1,
00051               ZData = 2,
00052               VData  =3 };
00056     QSSurface(QSAxes* parent, const char * name=0);
00060     virtual ~QSSurface();
00061     void setXGridStep( int step );
00062     void setYGridStep( int step );
00063     int xGridStep() const { return m_x_grid_step; }
00064     int yGridStep() const { return m_y_grid_step; }
00065     virtual QString posInfo( QSPt2f& pos );
00066     virtual QSPt2f legendItemSize( QSDrv *drv );
00067     virtual void drawLegendItem( const QSPt2f& pos, QSDrv *drv );
00068     virtual void loadStateFromStream( QDataStream& stream, QSObjectFactory *factory );
00069     virtual void saveStateToStream( QDataStream& stream, QSObjectFactory *factory );
00070         virtual ColumnType columnType( int channel, int column ) const;
00071     virtual QString channelVariable( int channel ) const;
00072 
00073    protected:
00074       virtual void dataChanged( int channel = -1 );
00075       virtual void allocRuntimeData();
00076       virtual void freeRuntimeData();
00077       virtual bool getAxisRange( QSAxis *axis, double& min, double& max );
00078       virtual bool start();
00079       virtual bool step();
00080       virtual void end();
00081 
00082     private:
00083     struct surface_runtime_data;
00084     struct surface_runtime_data *d;
00085         bool   m_minmax_z_valid;
00086     bool   m_minmax_v_valid;
00087         double m_max_z;
00088         double m_min_z;
00089     double m_min_v;
00090     double m_max_v;
00091     int m_x_grid_step;
00092     int m_y_grid_step;
00093 
00094         void init_loops();  
00095     void prepare_quarter();
00096     void draw_polygon( const QSPt3f pts[], QSPt3f *norm, const double *values=NULL, const bool *edges=NULL );
00097    };
00098 
00099 #endif
00100 
00101 
00102 
00103 
00104 
00105 
00106 
00107 
00108 
00109 
00110 
00111 
00112 
00113 
00114 
00115 
00116 
00117 
00118 
00119 
00120 
00121 
00122 
00123 
00124 
00125 
00126 
00127 
00128 
00129 
00130 
00131 
00132 
00133 
00134 
00135 
00136 
00137 
00138 
00139 
00140 
00141 
00142 
00143 
00144 
00145 
00146 
00147 
00148 
00149 

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