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

Txq2dDrawable.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 //
00003 // File:    Txq2dDrawable.h
00004 //
00005 // Purpose: This class can draw itself on a Txq2dCanvas object.
00006 //
00007 // Version: $Id: Txq2dDrawable.h,v 1.4 2001/10/10 22:41:05 kgl Exp $
00008 //
00009 // Author:  Kelly G. Luetkemeyer
00010 //
00011 //  modified from the Txq2dDrawable java class:
00012 // Project: Tech-X Foundation Classes
00013 //          David A. Alexander, Svetlana G. Shasharina, John R. Cary
00014 //
00015 // Copyright (c) 2000 by Tech-X Corporation.  All rights reserved.
00016 //---------------------------------------------------------------------------
00017 
00018 #ifndef TXQ2D_DRAWABLE_H
00019 #define TXQ2D_DRAWABLE_H
00020 
00021 // Qt includes
00022 #include <qpainter.h>
00023 #include <qpixmap.h>
00024 #include <qwmatrix.h>
00025 
00026 // Tx includes
00027 #include "TxqLog.h"
00028 #include "TxqDrawable.h"
00029 #include "TxqViewPort.h"
00030 
00043 class Txq2dDrawable: public TxqDrawable
00044 {
00045 
00046 public:
00047 
00051   Txq2dDrawable();
00052 
00056   virtual ~Txq2dDrawable();
00057 
00062   void update(QPainter* g) { paint(g); }
00063 
00069   virtual void paint(QPainter* g) =0; 
00070 
00075   double getXmin() { return view->getXmin();}
00076  
00081   double getXmax() { return view->getXmax();}
00082 
00083  
00088   double getYmin() { return view->getYmin();}
00089  
00094   double getYmax() { return view->getYmax();}
00095 
00101   double pixelToX( const QPoint & p) {return view->pixelToX(p);}
00102  
00108   double pixelToY( const QPoint & p) {return view->pixelToY(p);}
00109  
00117   QPoint xyToPixel( double x, double y ) {return view->xyToPixel(x,y);}
00118  
00126   short xToPixel( double x ) {return view->xToPixel(x);}
00127  
00135   short yToPixel( double y ) {return view->yToPixel(y);}
00136 
00143    void setViewPort(TxqViewPort* viewPort) {view = viewPort;}
00144  
00145 
00146 protected:
00147 
00151   TxqViewPort* view;
00152 
00153 
00154 };
00155 #endif
Copyright Tech-X Corporation, all rights reserved.