QualityGui Class Reference

The visual appearance of a QualityData. More...

#include <featuregui.h>

Inheritance diagram for QualityGui:

Inheritance graph
[legend]
Collaboration diagram for QualityGui:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 QualityGui (SpatialFeatureData *data)
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)

Private Member Functions

QualityDataqualityData ()

Detailed Description

The visual appearance of a QualityData.

Definition at line 120 of file featuregui.h.


Constructor & Destructor Documentation

QualityGui::QualityGui ( SpatialFeatureData data  )  [inline]

Definition at line 123 of file featuregui.h.

00123                                             : FeatureGui( data )
00124     {
00125 //         cerr << "in qualitygui ctor" << endl;
00126     }


Member Function Documentation

void QualityGui::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 
) [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.

Implements FeatureGui.

Definition at line 279 of file featuregui.cpp.

References QPainter::fillRect(), qualityData(), QBrush::setColor(), QColor::setHsv(), and QBrush::setStyle().

00281 {
00282     QString str;
00283     QBrush brush;
00284     brush.setStyle( Qt::SolidPattern );
00285 
00286     QColor color;
00287     brush.setColor( Qt::red );
00288     for ( int i = x1_dna; i <= x2_dna ; ++i )
00289     {
00290 //         color.setHsv( 0, 0, 255 -qualityData()->qualityVector.stlVector()[i] *4);
00291       
00292       int v_val = min<int>(255, qualityData()->qualityVector.stlVector()[i] *12);
00293       v_val = max<int>(v_val, 100);
00294 
00295       color.setHsv( 0, 0, v_val);
00296       
00297       brush.setColor( color );
00298       
00299       p->fillRect( static_cast<int>(x_pix + (i - x1_dna   )* width),
00300                    y_pix,  static_cast<int>(width), height , brush) ;
00301       
00302       
00303       
00304       
00305       
00306       
00307     }
00308     return;
00309 }

QualityData * QualityGui::qualityData (  )  [private]

Definition at line 274 of file featuregui.cpp.

References FeatureGui::m_data.

Referenced by paintMe().

00275 {
00276     return dynamic_cast<QualityData *>( m_data );
00277 }


The documentation for this class was generated from the following files:
Generated on Fri Jul 17 20:19:51 2009 for ngsview by  doxygen 1.5.1