Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

featuregui.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002  *                                                                             *
00003  *   Copyright (C) 2003  Erik Sjolund,  (<html>Erik Sj&ouml;lund</html>)       *
00004  *                       Center for Genomics and Bioinformatics,               *
00005  *                       Karolinska Institutet,                                *
00006  *                       Stockholm,                                            *
00007  *                       Sweden                                                *
00008  *                                                                             *
00009  *  Author: Erik Sjolund                                                       *
00010  *  Email: erik.sjolund@adivo.se                                               *
00011  *                                                                             *
00012  *******************************************************************************
00013  */
00014 
00015 #ifndef FEATUREGUI_H
00016 #define FEATUREGUI_H
00017 
00018 class QPainter;
00019 class Dbt;
00020 
00021 class FeatureData;
00022 class DnpData;
00023 class DnaStrData;
00024 class ChromatData;
00025 class QualityData;
00026 
00027 // just for Q_UINT64 ...
00028 
00029 #include <qpainter.h>
00030 #include <iostream>
00031 #include "trappertypes.h"
00032 
00033 using namespace std;
00034 
00035 /** \brief Abstract class for the visual appereance of a feature. Each FeatureData derived class will have a corresponding FeatureGui derived class with a specialized paintMe() method.
00036 
00037   */
00038 
00039 class FeatureGui
00040 {
00041 public:
00042   FeatureGui( FeatureData * data ) : m_data( data )
00043   {}
00044   virtual ~FeatureGui()
00045   {}
00046   void paint( QPainter * p, TR_PIX x_pix, TR_PIX y_pix, TR_DNA x1_dna, TR_DNA x2_dna,
00047               /*int*/double width, int height, int center);
00048 protected:
00049   FeatureData * m_data;
00050   /**
00051    * Paints the visual appearance of a feature.
00052    * @param p the QPainter to paint to
00053    * @param x_pix the pixel coordinate of the upper left corner of the rectangle where the feature should be painted 
00054    * @param y_pix the pixel coordinate of the upper left corner of the rectangle where the feature should be painted 
00055    * @param x1_dna the left most position that should be painted given as a dna coordinate relative the left side of the read.
00056    * @param x2_dna the right most position that should be painted given as a dna coordinate relative the left side of the read.
00057    */
00058   virtual void paintMe( QPainter * p, TR_PIX x_pix, TR_PIX y_pix, TR_DNA x1_dna, TR_DNA x2_dna,
00059                         /*int*/double width, int height, int center) = 0;
00060   
00061 };
00062 
00063 /** \brief The visual appearance of a DnpData  
00064   */
00065 
00066 class DnpGui : public FeatureGui
00067 {
00068 public:
00069     DnpGui( FeatureData * data ) : FeatureGui( data )
00070     {
00071 //         cerr << "in dnpgui ctor" << endl;
00072     }
00073     void paintMe( QPainter * p, TR_PIX x_pix, TR_PIX y_pix, TR_DNA x1_dna, TR_DNA x2_dna,
00074                   /*int*/double width, int height, int center);
00075     DnpData * dnpData();
00076 };
00077 
00078 /** \brief The visual appearance of a DnaStrData  
00079   */
00080 
00081 class DnaStrGui : public FeatureGui
00082 {
00083 public:
00084     DnaStrGui( FeatureData * data ) : FeatureGui( data )
00085     {
00086       f.setFamily("Luxi Mono");
00087       f.setFixedPitch( true );
00088       oldRequestedHeight = 0;
00089       oldRequestedWidth = 0;
00090       currentHeight = 0;
00091       currentWidth = 0;
00092       currentDescent = 0;
00093 //       cerr << "in dnastrgui ctor" << endl;
00094     }
00095   void paintMe( QPainter * p, TR_PIX x_pix, TR_PIX y_pix, TR_DNA x1_dna, TR_DNA x2_dna,
00096                 /*int*/double width, int height, int center);
00097 private:
00098   DnaStrData * dnaStrData( );
00099   QFont f;
00100   int currentWidth, currentHeight, oldRequestedHeight, oldRequestedWidth, currentDescent;
00101 };
00102 
00103 /** \brief The visual appearance of a ChromatData  
00104   */
00105 
00106 class ChromatGui : public FeatureGui
00107 {
00108 public:
00109   ChromatGui( FeatureData * data );
00110   void paintMe( QPainter * p, TR_PIX x_pix, TR_PIX y_pix, TR_DNA x1_dna, TR_DNA x2_dna,
00111                 /*int*/double width, int height, int center);
00112 private:
00113   ChromatData * chromatData( );
00114 };
00115 
00116 /** \brief The visual appearance of a QualityData  
00117   */
00118 class QualityGui : public FeatureGui
00119 {
00120 public:
00121     QualityGui( FeatureData * data ) : FeatureGui( data )
00122     {
00123 //         cerr << "in qualitygui ctor" << endl;
00124     }
00125     void paintMe( QPainter * p, TR_PIX x_pix, TR_PIX y_pix, TR_DNA x1_dna, TR_DNA x2_dna,
00126                   /*int*/double width, int height, int center);
00127 private:
00128     QualityData * qualityData( );
00129 };
00130 
00131 #endif

Generated on Fri Mar 17 17:44:24 2006 for trapper by  doxygen 1.4.4