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

qsdrvopengl.h

00001 /***************************************************************************
00002                              qsdrvopengl.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 QSDRVOPENGL_H
00020 #define QSDRVOPENGL_H
00021 
00022 #ifdef HAVE_CONFIG_H
00023 #include <config.h>
00024 #endif
00025 
00026 #ifdef HAVE_GL
00027 
00028 #include "qsdrvqt.h"
00029 #include <qgl.h>
00030 
00031 class QPainter;
00032 class QPixmap;
00033 class QPicture;
00034 class QSAxes3D;
00035 class QSProjection3D;
00036 
00043 class QSDrvOpenGL : public QSDrvQt
00044  {
00045   public:
00049      QSDrvOpenGL();
00053     virtual ~QSDrvOpenGL();
00057     virtual QSDrvOpenGL *copy();
00061     void copySettingsFrom( const QSDrvOpenGL *drv );
00065      void setAlpha( bool enabled );
00069          void setShadeWalls( bool enabled );
00073          void setGlobalTransparency( unsigned char value );
00077          void setMeshAutoStroke( bool enabled );
00081          void setAutoStrokeLightness( int value );
00085     bool alpha() const { return m_alpha; }
00089     bool shadeWalls() const { return m_shade_walls; }
00093     int globalTransparency() const { return m_global_transparency; }
00097     bool meshAutoStroke() const { return m_auto_stroke; }
00101     int meshAutoStrokeLightness() const { return m_stroke_lightness; }
00105          void init( QSAxes3D *parent );
00109      QSAxes3D *parentAxes() const { return m_axes3; }
00110          virtual void setClipping( bool enabled );
00111          virtual void setCurrentElement( int category, int element );
00112          virtual CNormals cNormals() const;
00113          virtual CColors cColors() const;
00114          virtual COrdering cOrdering() const;
00120     virtual void setDC( QPainter *p, double dpi = 72, bool deletePainter = false );
00121          virtual void startDrawing();
00122          virtual void stopDrawing();
00123 
00124          virtual void clearCanvas( const QSGFill& f, const QSPt2& pos, const QSPt2& size );
00125          virtual void drawPoly3( const QSPt3f pts[], int npoints,
00126                          const QSPt3f *nor, const QSGFill *col, const bool *edges = NULL, int edgeAutoColor = 0 );
00127          virtual void drawLine3( const QSPt3f& begin, const QSPt3f& end, const QSPt3f norm[2] );
00128          virtual void setFill( const QSGFill &f );
00129          virtual void setLine( const QSGLine &l );
00130 
00131   protected:
00132      QSAxes3D     *m_axes3;
00133          QPainter     *m_opaint;
00134          QGLContext   *pgl;
00135          QPainter     *ppic;
00136          QPixmap      *pix;
00137          QPicture     *pic;
00138          QPointArray  *points;
00139 
00140          GLuint  plist;
00141          GLubyte color[4];
00142          GLubyte lcolor[4];
00143 
00144          bool axis_mode;
00145          bool m_alpha;
00146          bool m_shade_walls;
00147          bool m_auto_stroke;
00148          bool dpaint;
00149          int  m_global_transparency;
00150          int  trv;
00151          int  m_stroke_lightness;
00152          int  pasize;
00153 
00154          const QSProjection3D *t;
00155          void loadMatrix( const double m[4][4] );
00156          void get_qpainter_wmatrix( const QPainter *p, double m[4][4] );
00157          void glError();
00158  };
00159 
00160 #endif // HAVE_GL
00161 #endif
00162 
00163 
00164 
00165 
00166 
00167 
00168 
00169 
00170 
00171 
00172 
00173 
00174 
00175 
00176 
00177 
00178 
00179 
00180 
00181 

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