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

qsfigure.h

00001 /***************************************************************************
00002                                 qsfigure.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 QSFIGURE_H
00020 #define QSFIGURE_H
00021 
00022 #ifdef HAVE_CONFIG_H
00023 #include <config.h>
00024 #endif
00025 
00026 #include"qsaxes.h"
00027 #include"qsplot.h"
00028 #include<vector.h>
00029 #include<math.h>
00030 
00031 
00032 
00033 
00041 class QSFigure : public QSPlot3D
00042  {
00043   Q_OBJECT
00044     Q_PROPERTY( int vertexCompareAccuracy READ vertexCompareAccuracy WRITE setVertexCompareAccuracy )
00045 
00046   public:
00047 
00058         enum Channels   { VXCoord = 0,
00059                           VYCoord = 1,
00060                           VZCoord = 2,
00061                           VVCoord = 3,
00062                           VTableI = 4 };
00063 
00067         QSFigure( QSAxes* parent, const char * name=0 );
00071        virtual ~QSFigure();
00079        void setVertexCompareAccuracy( int accuracy );
00083        int vertexCompareAccuracy() const { return m_accuracy; }
00084 
00085        virtual QString posInfo( QSPt2f& pos );
00086        virtual QSPt2f legendItemSize( QSDrv *drv );
00087        virtual void drawLegendItem( const QSPt2f& pos, QSDrv *drv );
00088     virtual void loadStateFromStream( QDataStream& stream, QSObjectFactory *factory );
00089     virtual void saveStateToStream( QDataStream& stream, QSObjectFactory *factory );
00090          virtual ColumnType columnType( int channel, int column ) const;
00091     virtual QString channelVariable( int channel ) const;
00092 
00093   protected:
00094 
00095       virtual void dataChanged( int channel = -1 );
00096       virtual void allocRuntimeData();
00097       virtual void freeRuntimeData();
00098       virtual bool getAxisRange( QSAxis *axis, double& min, double& max );
00099       virtual bool start();
00100       virtual bool step();
00101       virtual void end();
00102 
00103     private:
00104     struct figure_runtime_data;
00105       struct figure_runtime_data *d;
00106 
00107       int  m_accuracy;  // vertex comparing accuracy.
00108       bool m_extremes_valid; // are extremes valid
00109       bool m_minmax_v_valid;
00110       QSPt3f m_dmin;    // minimum value in data
00111       QSPt3f m_dmax;    // maximum value in data
00112       double m_vmin;
00113       double m_vmax;
00114 
00115       void init_data();
00116       void init_draw();
00117       void init_colors();
00118       void init_draw_figure();
00119 
00120       void alloc_buffers();
00121       void free_buffers();
00122 
00123       void order_vertices_step();
00124       void init_find_neighbours();
00125       void find_neighbours_step();
00126       void draw_figure_step();
00127 
00128       bool is_equal( int bindex1, int bindex2 );
00129       void get_facet( int nr, QSPt3f *vert, double *values=NULL );
00130       void get_facet_colors( int findex, QSGFill *fbuff );
00131       void get_facet_normals( int findex, QSPt3f *normals );
00132       void get_vertex_normal( int bindex1, int bindex2, int inc, QSPt3f *normal );
00133       void draw_point_marks( int number, const QSPt3f* wbuff );
00134       void map_facet_to_world( const QSPt3f *vbuff, QSPt3f *wbuff );
00135  };
00136 
00137 #endif
00138 
00139 
00140 
00141 
00142 
00143 
00144 
00145 
00146 
00147 
00148 
00149 
00150 
00151 
00152 
00153 
00154 
00155 
00156 
00157 
00158 
00159 
00160 
00161 
00162 
00163 
00164 
00165 
00166 
00167 
00168 
00169 
00170 
00171 
00172 
00173 
00174 

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