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

FeatureGui Class Reference

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. More...

#include <featuregui.h>

Inheritance diagram for FeatureGui:

Inheritance graph
[legend]
Collaboration diagram for FeatureGui:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FeatureGui (FeatureData *data)
virtual ~FeatureGui ()
void paint (QPainter *p, TR_PIX x_pix, TR_PIX y_pix, TR_DNA x1_dna, TR_DNA x2_dna, double width, int height, int center)

Protected Member Functions

virtual void paintMe (QPainter *p, TR_PIX x_pix, TR_PIX y_pix, TR_DNA x1_dna, TR_DNA x2_dna, double width, int height, int center)=0

Protected Attributes

FeatureDatam_data

Detailed Description

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.

Definition at line 39 of file featuregui.h.


Constructor & Destructor Documentation

FeatureGui::FeatureGui FeatureData data  )  [inline]
 

Definition at line 42 of file featuregui.h.

00042                                    : m_data( data )
00043   {}

virtual FeatureGui::~FeatureGui  )  [inline, virtual]
 

Definition at line 44 of file featuregui.h.

00045   {}


Member Function Documentation

void FeatureGui::paint QPainter *  p,
TR_PIX  x_pix,
TR_PIX  y_pix,
TR_DNA  x1_dna,
TR_DNA  x2_dna,
double  width,
int  height,
int  center
 

Definition at line 26 of file featuregui.cpp.

References FeatureData::endPos(), m_data, paintMe(), FeatureData::startPos(), and TR_DNA.

Referenced by TrapperView::paintFeatures().

00028 {
00029     /* we don't need to paint outside the window, thus we seak max and min values */
00030 
00031 //     TR_DNA x1_dna_cut = max( m_data->startPos(), x1_dna )  ;
00032 //     TR_DNA x2_dna_cut = min( m_data->endPos(), x2_dna );
00033 
00034     //EA smarter alternative?
00035   TR_DNA x1_dna_cut;
00036   
00037   if ( (x1_dna_cut = max( m_data->startPos(), x1_dna )) > x2_dna )
00038     return;
00039   
00040   TR_DNA x2_dna_cut;
00041   
00042   if ( ( x2_dna_cut = min( m_data->endPos(), x2_dna ) ) < x1_dna )
00043     return;
00044     
00045 
00046     /*
00047     cerr << "uniquename=" << m_data->uniqueName()
00048 << " x1_dna=" << x1_dna 
00049          << " x2_dna=" << x2_dna
00050          << " startPos=" << m_data->startPos()
00051          << " endPos=" << m_data->endPos()
00052          << " x1_dna_cut=" << x1_dna_cut
00053          << " x2_dna_cut=" << x2_dna_cut
00054          << endl;
00055     */
00056   
00057            x_pix  += ( x1_dna_cut - x1_dna ) * width;
00058 
00059 
00060     paintMe( p, x_pix, y_pix, x1_dna_cut, x2_dna_cut, width, height, center);
00061 }

virtual void FeatureGui::paintMe QPainter *  p,
TR_PIX  x_pix,
TR_PIX  y_pix,
TR_DNA  x1_dna,
TR_DNA  x2_dna,
double  width,
int  height,
int  center
[protected, pure virtual]
 

Paints the visual appearance of a feature.

Parameters:
p the QPainter to paint to
x_pix the pixel coordinate of the upper left corner of the rectangle where the feature should be painted
y_pix the pixel coordinate of the upper left corner of the rectangle where the feature should be painted
x1_dna the left most position that should be painted given as a dna coordinate relative the left side of the read.
x2_dna the right most position that should be painted given as a dna coordinate relative the left side of the read.

Implemented in DnpGui, DnaStrGui, ChromatGui, and QualityGui.

Referenced by paint().


Member Data Documentation

FeatureData* FeatureGui::m_data [protected]
 

Definition at line 49 of file featuregui.h.

Referenced by ChromatGui::chromatData(), DnaStrGui::dnaStrData(), DnpGui::dnpData(), paint(), and QualityGui::qualityData().


The documentation for this class was generated from the following files:
Generated on Fri Mar 17 17:44:58 2006 for trapper by  doxygen 1.4.4