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

qsprojection2d.h

00001 /***************************************************************************
00002                                 qsprojection2d.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 QSPROJECTION2D_H
00020 #define QSPROJECTION2D_H
00021 
00022 #ifdef HAVE_CONFIG_H
00023 #include <config.h>
00024 #endif
00025 
00026 #include"qsprojection.h"
00027 
00032 class QSProjection2D : public QSProjection  {
00033 
00034   public:
00035      typedef double Matrix[3][3];
00036      Matrix T;
00037      Matrix IT;
00041      QSProjection2D();
00045     virtual ~QSProjection2D();
00049     static void matrixI( Matrix m );
00053     static void multiply( Matrix A, Matrix B );
00057     static void copy( Matrix dst, const Matrix src );
00061     static void applyT( Matrix m, double dx, double dy );
00065     static void applyS( Matrix m, double sx, double sy );
00069     static void inv( Matrix result, const Matrix m );
00073     static void applyViewport( Matrix m, double x, double y, double w, double h );
00077     double world2DToCanvasX( double x ) const;
00081     double world2DToCanvasY( double y ) const;
00085     double world2DToCanvasZ( double z ) const;
00089     double canvasXToWorld2D( double x ) const;
00093     double canvasYToWorld2D( double y ) const;
00097     double canvasZToWorld2D( double z ) const;
00101     virtual QSPt2f world2DToCanvas( const QSPt2f& p ) const;
00105     virtual QSPt3f world2DToCanvas3( const QSPt2f& p ) const;
00109     virtual QSPt2f world3DToCanvas( const QSPt3f& p ) const;
00113     virtual QSPt3f world3DToCanvas3( const QSPt3f& p ) const;
00117     virtual QSPt3f canvas3ToWorld3D( const QSPt3f &p ) const;
00121     virtual QSPt2f worldTransformation( const Matrix m, const QSPt2f& p ) const;
00122 
00123     void setClipRect( double x1, double y1, double x2, double y2 );
00124     void getClipRect( double *x1, double *y1, double *x2, double *y2 ) const;
00125 
00126    private:
00127      // clip rectangle
00128      QSPt2f m_cmin;
00129      QSPt2f m_cmax;
00130   };
00131 
00132 
00133 #endif
00134 
00135 
00136 
00137 
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 

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